C Water Tank Pump Simulator

C Water Tank Pump Simulator

C Water Tank Pump Simulator

工作概述

地點
全球
工作類型
Freelancer.com
薪水
$103 - $206 項目報價
發布日期
16 小時 前

額外細節

作業編號
58386
工作視圖
3

職位描述

Code requirements:
Write the program in C using only techniques covered in Lectures 1–4: variables, arithmetic,
conditional statements, loops, and formatted console input/output. Do not use arrays, strings,
structures, files or user-defined functions.
Reject invalid section counts, invalid material selections, and non-positive forces, lengths or
diameters. When an invalid value is entered, ask for that value again before proceeding.
Hint: The results for each section may be displayed as they are calculated. Store only the
running totals and the minimum factor of safety, rather than all section data.
Exercise B –20 Marks
Water Storage and Pump Control Simulation
Write a C program that simulates a 100 m³ water tank supplying an industrial facility.
Compare three independent pump operating strategies using hourly calculations over 1 to 3
days.
Water balance
Vnew = Vold + Vin + Vpump − Vdemand
V is stored water volume (m³). Natural inflow is constant at 2 m³/hour; the electrically
powered pump supplies 8 m³/hour when on and consumes 3 kW. The facility uses 5 m³/hour
between 07:00 and 21:59, and 3 m³/hour between 22:00 and 06:59. Each time step is one
hour, so the hourly transferred volume in m³ equals the numerical flow rate in m³/hour. An
operating pump uses 3 kWh in one hour.
If the calculated volume exceeds 100 m³, record the excess as overflow and set stored water
to 100 m³. If it is below 0 m³, record the deficit as unmet demand and set stored water to 0
m³. Track these two quantities separately for each strategy.
Pump control strategies
Strategy 1: Pump runs continuously.
Strategy 2: Pump runs if the volume at the BEGINNING of the hour is below 50 m³;
otherwise it remains off.
Strategy 3: Pump runs during 22:00–06:59. Outside these times, it runs only if the volume at
the BEGINNING of the hour is below 20 m³.
Determine the pump state at the beginning of each hour and keep it unchanged throughout
that hour. The first interval is 00:00–00:59. Calculate the final volume and any overflow or
unmet demand at the end of each hour.
Program requirements
1. Request the initial tank volume (0–100 m³) and the number of simulation days (1–3),
rejecting and re-requesting invalid values.
2. Initialise three separate tanks to the same initial volume. Use a single hourly loop to
update all three strategies, determining the time of day and demand for each hour.
3. For each strategy, decide whether to run the pump, calculate the updated volume, apply
the 0 and 100 m³ limits and accumulate overflow, unmet demand, operating hours and
electricity consumption.
4. For every hour, print the hour number, starting clock time and the stored volume for each
of the three strategies in a side-by-side table.
5. After all hours, show the final volume, total overflow, unmet demand, pump operating
hours and energy consumed for each strategy. Identify a strategy having the lowest
energy consumption (ties may be resolved arbitrarily).
6. Ask whether another simulation is required (1 = yes, 0 = no).
Comment and explain any loop conditions in your code using binary [login to view URL] it vertically
Example of the first five hours
For initial water volume 35.00 m³:
Hour | Time | Strategy 1 | Strategy 2 | Strategy 3
1 | 00:00 | 42.00 | 42.00 | 42.00
2 | 01:00 | 49.00 | 49.00 | 49.00
3 | 02:00 | 56.00 | 56.00 | 56.00
4 | 03:00 | 63.00 | 55.00 | 63.00
5 | 04:00 | 70.00 | 54.00 | 70.00
For the final summary: display one row for each quantity and columns for Strategy 1,
Strategy 2 and Strategy 3.
Use C console programming techniques from Lectures 1–4 only.
Hints:
Use separate volume, energy, overflow and unmet-demand variables for each strategy. Name these Vst1o ld Vst2old Vs t3old.
The remainder operator (%) can be used to find the hour of the day. You shou ld overwrite the values

---
來源:Freelancer.com | 出價次數:4 | 剩餘時間:6 日 | 專案類型:固定預算

常見問題 FAQ

點樣申請呢份工?

請點擊頁面上嘅「立即申請」按鈕,或者按照聯絡資料聯絡僱主。

申請後幾耐有回覆?

回覆時間視乎僱主,一般 1-2 星期內會有面試邀請。

呢份工係唔係真實㗎?

EZJobs 上嘅所有職位都經過審核,確保真實有效。

地點

🌍

🌍 遙距工作 · 全球可做

此項目為自由職業性質,不限工作地點,可於全球任何地方遙距完成。

工作模式:自由職業

類似職位

Freelance · 自由職業

Raspberry Pi Christmas Light Show Setup

Freelancer.com

Freelance · 自由職業

Wellness Blog Article Creation

Freelancer.com

Freelance · 自由職業

iOS App修正及重新上架

Freehunter

Freelance · 自由職業

Business Website Content Creation

Freelancer.com

COOKIE

本網站使用 cookie 來確保您在我們的網站上獲得最佳體驗。

接受