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 fuel cell manufacturer can hire union, non-union permanent, or temporary help. She has a contract to produce at the rate of 2,100 fuel cells per day and would like to achieve this at minimum cost....
-
L. Thomas Company debits Supplies Expense for all purchases of supplies and credits Rent Revenue for all advanced rentals. For each type of adjustment, give the adjusting entry.
-
Fresh Food Direct, LLC, entered into a lease agreement with Jet Star Realty, LLC. Fresh Food terminated the lease before its terms end, and the parties disputed the amount of rent that Fresh Food...
-
The Battery Park Stable feeds and houses the horses used to pull tourist-filled carriages through the streets of Charleston's historic waterfront area. The stable owner, an ex-racehorse trainer,...
-
In establishing a new herb farm, your employer has asked you to estimate the bulk density of the farm's soil. Here are the raw data you have assembled using five relatively undisturbed soil cores...
-
Determine the monthly cash flows and total cash generated at the end of each month and just before the payment is received for the construction of a house with the following budget and schedule. On...
-
Labrador Corp. reports a net operating loss of $100,000 during its first year of operations. The company is subject to a tax rate of 30%. Management expects that taxable income will more likely than...
-
Which response would be the most appropriate and positive tone to reply to your audience with? 1. It is utterly impossible to ship your order tomorrow. 2. We will try our best to ship your order...
-
The most distinguishing feature of common law is the reliance on the doctrine of precedent when making court judgments. It is not restricted to judicial decisions generated within Hong Kong but case...
-
Your project sponsor has set a limit on the amount of money you can spend. You know your budget will exceed that limit. Using the information covered in the required readings, describe the importance...
-
Explore how the role of a people professional (specialist or generalist) is evolving and the implications this has for your CPD . Identify and explain how the role of a people professional is...
-
I have a question in regards to the fair value adjustment in this problem. On 1/1/19 Thomas purchased $300,000 in 8% 5 year bonds when the effective interest rate was 10%. The bonds pay interest on...
-
For a typical second order closed-loop system in the following format where b and c are positive real values: (1) (ii) 1 s + bs + c T(S) Calculate the sensitivity ST. Determine the condition for b...
-
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...
-
Find the state vector via the formal-solution approach. \(\dot{\mathbf{x}}=\left[\begin{array}{cc}5 & 1 \\ -4 & 1\end{array} ight] \mathbf{x}+\left[\begin{array}{c}1 \\ -1\end{array} ight] u, \quad...
-
A nonlinear dynamic system is described by a. Use the Simulink model to plot x 2 ( t ) x 2 ( t ) . b. Derive the linearized model analytically, build its Simulink model where the linear model is...
-
Consider the mechanical system in Figure 8.28. Assuming \(m=12 \mathrm{~kg}\), \(b=20 \mathrm{~N}\)-sec \(/ \mathrm{m}, k=200 \mathrm{~N} / \mathrm{m}, F_{0}=47 \mathrm{~N}\), and \(\omega=5...
Study smarter with the SolutionInn App