Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ code HELP NEEDED!!: Nrite a program that do the following unit conversion based on user menu selection: (use while or do-while loop until the

C++ code HELP NEEDED!!:image text in transcribedimage text in transcribedimage text in transcribed

Nrite a program that do the following unit conversion based on user menu selection: (use while or do-while loop until the user enter 'Quit' selection) 1. Seconds to hours, minutes and seconds (must implement as a function) - inputs an integer that represents a length of time in seconds. The program should then output the number of hours, minutes, and seconds that corresponds to that number of seconds. - Test Cases: If the user input 50391 total seconds then the program should output 13 hours, 59 minutes, and 51 seconds. If the user input is 80, then your program should ask user to reenter a valid number. - Your program must check for valid input (positive integer only) 2. Fahrenheit to Celsius (must implement as a function) - Inputs an Fahrenheit the program will convert to Celsius. - For example, input 82 the program should output 27.8 - F to C - Deduct 32, then multiply by 5 , then divide by 9 - T(C)=(82F32)5/9=27.8C - Your program must check for valid input (number only) - Hint: use cin.fail() to check for valid input based on the cin data type (cin.clear(), cin.ignore() and cin.fail()) - Test cases: If user enters non-digits such as "abc" then your program should ask user to enter a valid number. If user enters 82 , the program should output 27.8C 3. Celsius to Fahrenheit (must implement as a function) - Inputs Celsius the program will convert to Fahrenheit. - For example, input 12 the program should output 53.6 - C to F - Multiply by 9 , then divide by 5 , then add 32 - Convert 12 degrees Celsius to degrees Fahrenheit: - T(F)=12C9/5+32=53.6F - Your program must check for valid input (number only) 2023 8:07:49 PM Page 1 of 7 - Test cases: If user enters non-digits such as "fifty" then your program should ask user to enter a valid number. If user enters 40 , the program should output 104.0F Modify the printMeFirst() function below to include your personal information, and call efore anything else. Below is the sample of the program template include include > include iomanip > include > ising namespace std; ou can use the following template for all your function documentation format *** Based on Microsoft Visual Studio 2022 **** rintMeFirst.cpp rintMeFirst.h

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

User Defined Tensor Data Analysis

Authors: Bin Dong ,Kesheng Wu ,Suren Byna

1st Edition

3030707490, 978-3030707491

More Books

Students also viewed these Databases questions