My question is about function in c++ Recently, the world has been infected with Covid-19 pandemic. You as a programmer has been asked by the Ministry of Health Malaysia to develop a system, that able to perform a fast analysis to categorise whether the user has a Covid-19 symptom or not. The result of the analysis will be based on the user’s inputs that correspond to several questions. Finally, the system will display the result and accumulative numbers of the user that has a Covid-19 symptom and no Covid-19 symptom. i) Write the definition of the main()function. • prompts the user to input his/her full name, address and age. • calls the symptom() and pass age as an argument. The symptom() will return a value and stored in a variable called finalResult. • in each iteration, display the analysis’ result based on the conditions set in Table 1. • ask the user whether to repeat the process or not. If the user decided not to repeat then display the total number of patients, the total number of Non-Covid- 19 patients and the total number of Covid-19 patients. Table 1: Symptom decision result Range of final result Description of the result 0 ≤ ?inalResult ≤ 2 No COVID-19 symptom 2 < ?inalResult≤ 4 You had COVID-19 symptom ?inalResult < 0 OR ?inalResult > 4 The age entered is invalidii) Write the definition of the symptom() function. • receives the age as a parameter from the main() function. • calls the analysis() function with no argument. The analysis() function gets called based on the conditions in Table 2 and will return a value stored in a variable called total to this function. • returns the value of the formula to the main() function. Table 2: Range of patient’s age mapped to the mark of age Range of age Mark of age 0 < age ≤ 17 1 17 < age ≤ 55 0 55 < age ≤ 95 1 age < 0 OR age> 95 -1Calculation formula: Mark of the age + total;   iii) Write the definition of the analysis() function. • The analysis is performed according to several questions as shown in Table 3. • the weighted from the user’s response will be used for the analysis calculation. • returns the value of the formula given below to symptom() function. Table 3: Question for analysis Weighted from user’s respond Question Yes No 1. Have you engaged with COVID-19 patient? [Y/N] 1 0 2. Have you got a fever? [Y/N] 1 0 3. Have you got breathing difficulties? [Y/N] 1 0 Calculation formula: Weighted Question 1 + Weighted Question 2 + Weighted Question 3; Here's the sample output attached

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

My question is about function in c++

Recently, the world has been infected with Covid-19 pandemic. You as a programmer has
been asked by the Ministry of Health Malaysia to develop a system, that able to perform a
fast analysis to categorise whether the user has a Covid-19 symptom or not. The result of
the analysis will be based on the user’s inputs that correspond to several questions.
Finally, the system will display the result and accumulative numbers of the user that has a
Covid-19 symptom and no Covid-19 symptom.
i) Write the definition of the main()function.
• prompts the user to input his/her full name, address and age.
• calls the symptom() and pass age as an argument. The symptom() will
return a value and stored in a variable called finalResult.
• in each iteration, display the analysis’ result based on the conditions set in
Table 1.
• ask the user whether to repeat the process or not. If the user decided not to
repeat then display the total number of patients, the total number of Non-Covid-
19 patients and the total number of Covid-19 patients.
Table 1: Symptom decision result
Range of final result Description of the result
0 ≤ ?inalResult ≤ 2 No COVID-19 symptom
2 < ?inalResult≤ 4 You had COVID-19 symptom
?inalResult < 0 OR ?inalResult > 4 The age entered is invalid
ii) Write the definition of the symptom() function.
• receives the age as a parameter from the main() function.
• calls the analysis() function with no argument. The analysis() function gets
called based on the conditions in Table 2 and will return a value stored in a variable
called total to this function.
• returns the value of the formula to the main() function.
Table 2: Range of patient’s age mapped to the mark of age
Range of age Mark of age
0 < age ≤ 17 1
17 < age ≤ 55 0
55 < age ≤ 95 1
age < 0 OR age> 95 -1
Calculation formula: Mark of the age + total;

 

iii) Write the definition of the analysis() function.
• The analysis is performed according to several questions as shown in Table 3.
• the weighted from the user’s response will be used for the analysis calculation.
• returns the value of the formula given below to symptom() function.
Table 3: Question for analysis
Weighted from user’s respond
Question Yes No
1. Have you engaged with COVID-19 patient? [Y/N] 1 0
2. Have you got a fever? [Y/N] 1 0
3. Have you got breathing difficulties? [Y/N] 1 0

Calculation formula: Weighted Question 1 + Weighted Question 2 + Weighted Question 3;

Here's the sample output attached

 

 

Enter your name: Muhammad Imran bin Daud
Enter your address: 5, Lorong Haji Salleh
Enter your age: 21
Have you engaged with COVID-19 patient? [Y/N): N
Have you got a fever? [Y/N]: N
Have you got breathing difficulties? [Y/N): Y
---- Analysis Result
Name: Muhammad Imran bin Daud
Address: 5, Lorong Haji Salleh
Age: 21
COVID-19 Analysis Result: No COVID-19 symptom.
Thank You
Do you want to perform another analysis? [Y/N]: N
Total patients: 4
Total Non-COVID-19 patients: 2
Total COVID-19 patients: 2
Transcribed Image Text:Enter your name: Muhammad Imran bin Daud Enter your address: 5, Lorong Haji Salleh Enter your age: 21 Have you engaged with COVID-19 patient? [Y/N): N Have you got a fever? [Y/N]: N Have you got breathing difficulties? [Y/N): Y ---- Analysis Result Name: Muhammad Imran bin Daud Address: 5, Lorong Haji Salleh Age: 21 COVID-19 Analysis Result: No COVID-19 symptom. Thank You Do you want to perform another analysis? [Y/N]: N Total patients: 4 Total Non-COVID-19 patients: 2 Total COVID-19 patients: 2
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education