1: Data definitions and Input-Output functions Write a program that stores the mark allocation weights for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1: Data definitions and Input-Output functions Write a program that stores the mark allocation weights for 4 assessments as shown in the table below in an array. The program must prompt the user to enter their full name and the 4 mark assessments as follows: "Please enter your first name and your last name: " "Please enter the project mark: " "Please enter the practical mark: " "Please enter test 1 mark: "Please enter test 2 mark: The program must use the weights and the entered mark values to calculate the final mark for the student and display the student's name and final mark. Note: format the displayed values to two decimal points. The program must perform the following functionality: [10] (i) Creates a four-element array with the correct data type to store the weights. [2] (ii) Prompts the user to obtain the four assessment values. [4] (iii) Prompts the user to for their first name and last name. [1] (iv) Calculates the final mark. [2] (v) Prints the student name and final mark to the screen. [1] Assessment Description Weight Project 0,35 Practical 0,15 Test 1 0,25 Test 2 0,25 a) Create a new document in Word called CPractical 1. [2] b) Type your name and student number at the top of the Word document. [1] c) Document a detailed algorithm for the above problem in the Word document? [6] d) Document a flowchart based on the algorithm for the above problem in the Word document? [ 1 e) Write a C program to implement the steps described above? f) Copy and paste the C program into the Word document. Question 2: For loop [25] Consider an electrical circuit with five resistors in parallel. The voltage source across the resistors is 5V. Write a C program to calculate the current flow through each resistor. Copy and paste the C program into the Word document. Note: format the displayed values to two decimal points. The program must perform the following functionality: (i) Creates a five-element array with the correct data type to store the resistor values. [3] (ii) Creates a five-element array with the correct data type to store the current values. [3] (iii) Use a for loop construct to calculate the current flow through each resistor [10] (iv) Store the calculated current value the correct element of the current array [3] (v) Use a for loop construct to print the value of the resistor and the current that flows through the resistor [6] Resistor Value (ohms) R1 10 R2 20 R3 100 R4 125 R5 200 The output must look as follows: "R1 = 10 ohms and il 0,50 A" "R2 = 10 ohms and il = 0,25 A" Etc. 1: Data definitions and Input-Output functions Write a program that stores the mark allocation weights for 4 assessments as shown in the table below in an array. The program must prompt the user to enter their full name and the 4 mark assessments as follows: "Please enter your first name and your last name: " "Please enter the project mark: " "Please enter the practical mark: " "Please enter test 1 mark: "Please enter test 2 mark: The program must use the weights and the entered mark values to calculate the final mark for the student and display the student's name and final mark. Note: format the displayed values to two decimal points. The program must perform the following functionality: [10] (i) Creates a four-element array with the correct data type to store the weights. [2] (ii) Prompts the user to obtain the four assessment values. [4] (iii) Prompts the user to for their first name and last name. [1] (iv) Calculates the final mark. [2] (v) Prints the student name and final mark to the screen. [1] Assessment Description Weight Project 0,35 Practical 0,15 Test 1 0,25 Test 2 0,25 a) Create a new document in Word called CPractical 1. [2] b) Type your name and student number at the top of the Word document. [1] c) Document a detailed algorithm for the above problem in the Word document? [6] d) Document a flowchart based on the algorithm for the above problem in the Word document? [ 1 e) Write a C program to implement the steps described above? f) Copy and paste the C program into the Word document. Question 2: For loop [25] Consider an electrical circuit with five resistors in parallel. The voltage source across the resistors is 5V. Write a C program to calculate the current flow through each resistor. Copy and paste the C program into the Word document. Note: format the displayed values to two decimal points. The program must perform the following functionality: (i) Creates a five-element array with the correct data type to store the resistor values. [3] (ii) Creates a five-element array with the correct data type to store the current values. [3] (iii) Use a for loop construct to calculate the current flow through each resistor [10] (iv) Store the calculated current value the correct element of the current array [3] (v) Use a for loop construct to print the value of the resistor and the current that flows through the resistor [6] Resistor Value (ohms) R1 10 R2 20 R3 100 R4 125 R5 200 The output must look as follows: "R1 = 10 ohms and il 0,50 A" "R2 = 10 ohms and il = 0,25 A" Etc.
Expert Answer:
Related Book For
Differential Equations and Linear Algebra
ISBN: 978-0131860612
2nd edition
Authors: Jerry Farlow, James E. Hall, Jean Marie McDill, Beverly H. West
Posted Date:
Students also viewed these programming questions
-
The value of a resistor R is to be determined using the ammetervoltmeter setup shown in Figure P28.63. The ammeter has a resistance of 0.500 Ω, and the voltmeter has a resistance of 20 000...
-
Rewrite Programming Exercise 5.39 as follows: ? Use a for loop instead of a do-while loop. ? Let the user enter COMMISSION_SOUGHT instead of fixing it as a constant. You have just started a sales job...
-
Use a for loop to plot the function given in Problem 16 over the interval -2 x 6. Properly label the plot. The variable y represents height in kilometers, and the variable x represents time in...
-
A sealed flask contains water and oxygen gas at 25C. The O 2 gas has a partial pressure of 1.5 atm. (a) What is the concentration of O 2 in the water? (b) If the pressure of O 2 in the flask is...
-
A local packaging plant implements various production lines based on the product to be packaged. Each line is for a different product, some being more complicated than others. With several lines...
-
A steel tank is completely filled with 2.80 m3 of ethanol when both the tank and the ethanol are at a temperature of 32.0C. When the tank and its contents have cooled to 18.0C, what additional volume...
-
Explain the nature and roles of accounting and finance.
-
The Evanstonian is an upscale independent hotel that caters to both business and leisure travelers. On aver-age, one- third of the guests checking in each day are leisure travelers. Leisure travelers...
-
This sheet contains monthly exchange rate. Value of each currency is quoted in USD 1. Which currency has the highest average percentage change (in absolute term) For each currency, you calculate...
-
LOT is a partnership owned by Long, Oliver, and Taker. The partners' profit-and loss- sharing ratio is 2:2:1, respectively. The adjusted trial balance of the partnership at November 30, 2018,...
-
The manufacturing cost accounts of Varsity Manufacturing Co . provide the following information for the year ended December 3 1 , 2 0 2 0 Direct materials used . . . . . . . . . . . . . . . . . . . ....
-
Use the definition of the derivative (AKA the four step process) to find the derivative of f(x) = x - 7x+6 ==
-
Sally earns gross wages of $1200 per week. She has standard deductions for social security and medicare. She is single with 1 allowance. She also has 6% of her gross wages put into a retirement...
-
Warranty expense is expected to be 2% of sales and should be accrued in the period of the sale. The 2022 beginning and ending balances of the company's warranty liability were $24,000 and $28,000,...
-
During 2022, Illini, Inc. was involved in pending litigation due to defective products sold during the year. As of December 31, 2022, Illini, Inc. estimated a loss of $1,500,000 was probable. In...
-
LemonWheel, Inc began 2023 with $6,296,053 in cash. Over the course of 2023, they experienced the following changes in their balance sheet. What is the ending cash balance for LemonWheel in 2023?...
-
13. A heavy rope, 40 ft long, weighs 0.4 lb/ft and hangs over the edge of a building 110 ft high. How much work is done in pulling the rope to the top of the building? How much work is required to...
-
Kims Konstructions has assembled the following data for a proposed straw-reinforced brick maker (SRBM): SRBM Cost: $26,000 Life: 5 years Revenue (p.a.) $11,000 Operating Expenses (p.a.) $3,000...
-
Refer to the final subsection "Logistic Model in Another Context" and Fig. 2.5.9 to explore the application of the logistic equation to the oil industry, as follows. (a) The phrase "Hubbert peak"...
-
Repeated Euler-Cauchy Roots Verify that if the characteristic equation (15) for the Euler-Cauchy equation (14) has a repeated real root r, a second solution is given by tr In tr and that tr and tr In...
-
For the competition model dx/dt = x(a - bx - cy). dy/dt = y(d - ex - fy), Where the parameters a, b, c. d, e, and f are all positive, the diagrams in Problems show four possible positions of the...
-
A hospital reported the following statistics for the past year: births, 1,702; deliveries, 1,708; C-sections, 360; and obstetrical discharges, 1,827. The C-section rate for that year IS a. 0.21% b....
-
The consultation rate (including newborns) is _ _ . a. 0.03% b. 0.30% c. 3.09% d. 30.99%
-
The hospital-acquired infection rate (including newborns) is __ . a. 0.03% b. 0.30% c. 3.00% d. 30.00%
Study smarter with the SolutionInn App