Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
Step by Step Solution
★★★★★
3.41 Rating (148 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started