Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ using Visual Studios Goals: Practicing simple ifs and 2-way branches and nested ifs. Problem: You are to create a program to aid in the

image text in transcribedC++ using Visual Studios
Goals: Practicing simple ifs and 2-way branches and nested ifs. Problem: You are to create a program to aid in the conversion from Celsius to Fahrenheit and from Fahrenheit to Celsius the user to enter C or e when he she wants to convert from Celsius to our program should ask Fahrenheit and enter For fwhen heshe wants to convert from Fahrenheit to Celsius, Use a simple if (no else) to prompt the user to enter C,c, F, or F when he/she has entered another character (refer to the calculator demo program). Assume the user would not enter an incorrect character twice. Store the user's input as a single character, do not use a C-string or a string object Next your program should prompt the user to enter the temperature to be converted and employ a 2-way branch (if-else) to execute the conversion (one branch for when the user entered C or c Lab 2 CMPSC 201-Spring 2018 and another when the user entered F or f). Output the user's input and the coresponding temperature in the other scale. The formula for conversion are: C-5F-32) F-9/SC+32 Some sample runs are given below (user's input is show in bold characters. Enter C or c to convert from Celsius to Fahrenheit or Enter F or fto convert from Fahrenheit to Celsius. C Enter the temperature in Celsius you want to convert to Fahrenheit. 100 100 degrees Celsius corresponds to 212 degrees Fahrenhcit Enter C or e to convert from Celsius to Fahrenheit or Enter F or fto convert from Fahrenheit to Celsius e Enter the temperature in Celsius you want to convert to Fahrenbeit. 38 38 degrees Celsius corresponds to 100.4 degrees Fahrenheit. Enter C or c to convert from Celsius to Fahrenheit or Enter F or fto convert from Fahrenhcit to Celsius. F Enter the temperature in Fahrenheit you want to convert to Celsius.-40 40 degrees Fahrenheit comesponds to -40 degrees Celsius Enter C or c to convert from Celsius to Fahrenheit or Enter F or f to convert from Fahrenheit to Celsius f Enter the temperature in Fahrenheit you want to convert to Celsius. 73.5 73.5 degrees Fahrenheit corresponds to 23.0556 degrees Celsius. Enter C or e to convert from Celsius to Fahrenheit or Enter F or fto convert from Fahrenheit to Celsius. K You entered an incorrect choice Enter C or c to convert from Celsius to Fahrenheit or Enter F or fto convert from Fahrenheit to Celsius f Enter the temperature in Fahrenheit you want to convert to Celsius. 32 32 degrees Fahrenbeit corresponds to 0 degrees Celsius

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_2

Step: 3

blur-text-image_3

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

- What are your current coaching strengths/challenges?

Answered: 1 week ago