write the programm with given instructions

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

write the programm with given instructions

 

You are advised to make the following functions in the C file:
1. A function called average: Takes twofloating point numbers and returns their
average value
2. A function called wholePart: Takes one floating point number and returns its
integer whole part. E.g. the integer whole part of 3.1416 will be 3.
Once you have created the above functions, you may proceed to make the following program.
i. display the following menu from main():
Main Menu:
| 1- To get the whole number part of decimal number
2- To get average of 2 numbers
Press 0 to close the program:
Any other option will take you back to main menu:
The option entered will be then evaluated using switch case construct.
Make sure that if the user gives the wrong option, the program displays an error as
"Incorrect input, please pick the correct option." After this the menu is displayed
again.
If the user selects the option to close the program, then the program should
terminate. DO NOT, go to getch);
iv. Based upon this option, use a switch case construct to call the appropriate
i.
ii.
iii.
function.
These options will require user inputs, which you can take in the different case
v.
clauses appropriately.
vi.
Display the returned result to user in the main) and then return to main menu.
Transcribed Image Text:You are advised to make the following functions in the C file: 1. A function called average: Takes twofloating point numbers and returns their average value 2. A function called wholePart: Takes one floating point number and returns its integer whole part. E.g. the integer whole part of 3.1416 will be 3. Once you have created the above functions, you may proceed to make the following program. i. display the following menu from main(): Main Menu: | 1- To get the whole number part of decimal number 2- To get average of 2 numbers Press 0 to close the program: Any other option will take you back to main menu: The option entered will be then evaluated using switch case construct. Make sure that if the user gives the wrong option, the program displays an error as "Incorrect input, please pick the correct option." After this the menu is displayed again. If the user selects the option to close the program, then the program should terminate. DO NOT, go to getch); iv. Based upon this option, use a switch case construct to call the appropriate i. ii. iii. function. These options will require user inputs, which you can take in the different case v. clauses appropriately. vi. Display the returned result to user in the main) and then return to main menu.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY