Concept explainers
The formula for converting centigrade temperatures to Fahrenheit is
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
- Write a program that prompts the user to enter the month and first day of the month, and displays all the Sundays in that month. For example, if the user entered the month 7 for July, and the first day 4 for Wednesday, your program should display the following output:arrow_forwardWrite a pseudo code in which you ask the user to will enter a number and then enter 5 more numbers using the while statement to do this and in the end your program will show how much number were divisor by the number you enter at start. Also the program should terminate if the users enters a negative value at any stage. Enter a Number: 2Enter 1 Number: 4Enter 2 Number: 5Enter 3 Number: 6Enter 4 Number: 7Enter 5 Number: 8Total divisor are: 3arrow_forwardWrite a program that asks the user for a number in the range of 1 through 7. The programshould display the corresponding day of the week, where 1 = Monday, 2 = Tuesday, 3 =Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, and 7 = Sunday. The program shoulddisplay an error message if the user enters a number that is outside the range of 1 through 7arrow_forward
- a. Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less than 1, display an error message; otherwise, display the valid month with a message such as 3 is a valid month. b. Write a program named CheckM0nth2 that prompts a user to enter a birth month and day. Display an error message if the month is invalid (not I through 12) or the day is invalid for the month (for example, not between 1 and 31 for January or between I and 29 for February). If the month and day are valid, display them with a message.arrow_forwardWrite a Phyton program that computes the duration of a projectile’s flight and its height above the ground when it reaches the target. As part of your solution, you should display instructions to the program user. Relevant formula: time = distancevelocity xcos (θ) height = velocity xsin x time- g x time22 use the following variables: g = gravitational constant = 32.17 = angle of elevation in radian v = velocity or the projectile velocity (ft/sec) d= distance to target t = time of flight in seconds. h = height at impact Try your program on these data sets.arrow_forwardCreate a flowchart that will compute for the grade of students and print its equivalent grade point. The formula for computing the grade is : GRADE = 10% assignment + 20% seatwork + 30% quiz + 40% exam. Equivalent Grade point ---------------------- 1.0 - 99-100 1.25 - 96-98 1.50 - 93-95 1.75 - 90-92 2.0 - 87-89 2.25 - 84-86 2.50 - 81-83 2.75 - 78-80 3.0 - 75-77 5.0 - below 75arrow_forward
- Write a program that asks the user to enter two numbers between 200 and 1000, inclusive. If any of the numbers entered is outside the range above, display the message "Invalid number" and exit the program using System.exit(0); If the numbers are within the range, add the two numbers together and display the result.arrow_forwardBody Mass Index is a simple calculation using a person's height and weight. The formula is BMI = kg/m2 where kg is a person's weight in kilograms and m2 is their height in meters squared. Calculate a persons Body Mass index using their weight in pounds. This means you must first convert pounds to kilograms (kg) then apply the formula above. In converting pounds to kg, 1 pound = 0.453592 kg. So to convert pounds to kg, either multiply the pound value by 0.45359237 or divide by 2.2046226218. Then you must convert their height in inches to meters. The length in meters is equal to the inches multiplied by 0.0254. Write a program that accepts a users height as an integer in inches and their weight in pounds. Convert those inputs to their metric equivalents outlined above and determine their body mass index. Display what the conversions from and to their metric equivalents are. Display the body mass index and the category it belongs to.arrow_forwardSolve this please: A mobile phone app allows a user to press a button that starts a timer that counts seconds. When the user presses the button again, the timer stops. Draw a flowchart or write pseudocode that accepts the elapsed time in seconds and displays the value in minutes and seconds. For example, if the elapsed time was 130 seconds, the output would be 2 minutes and 10 seconds.arrow_forward
- Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where 1 = Monday, 2 = Tuesday and so forth. If the user types in a 6 then "Saturday" should be printed on the screen. For help with Input statements see: Input Function The program should print an error message if the user enters a number that is outside the range of 1 through 7. For help with If statements and conditions see the following pages: If-Else Statements and Operators. Name the source code file yourName_HW4_1.py. Test and run the program. Capture the output console and save it as an image file named yourName_HW3_output4_1.jpg. Submit the .py and the image files through Canvas.arrow_forwardPLEASE CODE THIS IN VISUAL CODE & MAKE SURE IT RUNSarrow_forwardusing flowcharts 11.Ask the user to enter a number and display a pattern based on the value of the number.Eg : 511 21 2 31 2 3 41 2 3 4 5 12. Write a program which accept a total time in minutes. Then calculate how many days, hours, minutes andseconds can be derived from the total time. Display on the screen the number of days, hours, minutes andseconds. 13.Write a program which accept a temperature value in Fahrenheit. Convert the value to Celsius and display itto the screen. Please use this formula ➔ Celsius = (Fahrenheit – 32) x (5/9) 14. Ask the user to enter a number and display a pattern based on the value of the number.Eg : 51 2 3 4 51 2 3 41 2 31 21arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning