Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASSIGNMENT 3 SEM 1, 2021/2022 INSTRUCTIONS TO THE STUDENTS Your programs must follow the input and output as required in the text and shown in

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

ASSIGNMENT 3 SEM 1, 2021/2022 INSTRUCTIONS TO THE STUDENTS Your programs must follow the input and output as required in the text and shown in the examples. You must test the programs with (but not limited to all the input given in the examples. Any form of plagiarisms is NOT ALLOWED. Students who copied other student's programs assignments will get ZERO mark (both parties, students who copied and students that Share their work). . Please insert your name, matrics number, and date as a comment in your program SUBMISSION PROCEDURE Please submit this assignment no later than January 24, 2022. . Only one submission that includes two files are required for the submission which is the source codes (the file with the extension CRP). Submit the assignment via the UTM's e-learning system. QUESTION 1 Given the formula for converting Fahrenheit (F) to Celcius (C): C = 5/9 x (F - 32) where C is the unit of temperature in Celcius and F is the unit of temperature in Fahrenheit. Write a complete C++ program that reads in a list of data F from a text file, then calculates the values of C using the formula given The program should use an array to store the values of F as example shown in Figure 1. 13.29 29.76 14.81 23.78 29.37 a Figure 1: Example of data F in the input file The program then prints a summary output onto the screen and the detail output into a text file as shown in Figures 2 and 3. Grades 'H' mean high temperature; 'M' is medium temperature and 'L' is low temperature. Your program must define several functions at least as listed in Table 1. You are also required to apply the concept of parameter passing to these functions. Average of the temperature: 32.3 Number of high temperature: 2 Number of medium temperature: 20 Number of low temperature: 8 Figure 2: Example of output on the screen C(Celcius) F (Faxenheit) Description === 54.94 19.86 93.70 13.77 130.89 67.75 200.67 56.78 H L H L Figure 3: Example of content in the output file Function HeadFile a. C. SRBOBTec a Table 1 Description This function reads in a list of numbers from a text file and stores them into a one- dimensional array. It receives the following parameters: The name of the text file to be read from b. An array to store the list of numbers read A variable to store the number of data read This function computes the values of C. It receives the following parameters: An array that contains data F 6. An array to store the calculated values of C The number of data This function computes the average of a list of numbers stored in an array. This function determines either temperature (C) is high or medium or low. This function will retum 'H' if C>35, MifC 20, and 'L'if C

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

=+What is the loss from infl ation and unemployment?

Answered: 1 week ago

Question

=+2. Is the hard sell approach unethical? Why or why not? [LO-2]

Answered: 1 week ago