Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Problem Solving with C++ plus MyProgrammingLab with Pearson eText-- Access Card Package (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Software Engineering (10th Edition)
Starting Out with Java: Early Objects (6th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Database Concepts (7th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- Write a program that will ask for an integer input from the user, loop terminates until a value zero (0) is entered. At the end, display the highest even number entered. If there are no even numbers found display “no even numbers”arrow_forwardWrite a program that will take a sentence from the user and uses a for loop to convert all lowercase characters to uppercase characters. Then output the converted sentence. Example, if the user enters “Hello World”, your program should output “HELLO WORLD”.arrow_forwardWrite a program that asks the user for a number of integer test scores. It then has the user enter that number of scores and computes the average. Ex: If the input is: 5 95 90 82 88 87 the output is: Your test average is: 88.4 You can assume that the first number is greater than 0. Hint: Use a loop to calculate the sum. When you are done with the loop, calculate the average. pythonarrow_forward
- Write a program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum USING RAPTORarrow_forwardWrite a program that reads in numbers from the user and outputs the information specified below. Part One: Get Valid Input Read in two integers from the user: a lower end of a range and an upper end of a range. Check if the numbers are valid (lower cannot be greater than upper). If the numbers are invalid, use a loop to ask for new numbers. Continue looping until you get two valid values. Part Two: Calculate the Sum Use a loop to calculate the sum of all values from lower (inclusive) to upper (inclusive). Output the sum to the user. Part Three: Analyze the Sum Determine if the sum is even or odd. Determine if the sum is positive, negative, or zero. Output this information to the user. Part Four: Calculate the Average Calculate the average of all numbers in the range from lower (inclusive) to upper (inclusive). Style and Additional Coding Requirements code should compile properly space and indent your code follow Java naming conventions for variables (lower camel case with no…arrow_forwardWrite a program that accepts 10 integers from the user using loops and then displays the sum of numbers which are less than 5 and sum of numbers which are greater than 10.arrow_forward
- Write a program that receives an integer input from the user and call it n. Use a for loop, an if condition, and a continue keyword, to find the summation of all numbers that are not a multiple of 3, from 1 to n, including 1 and n and print the result. For instance, the output of your program for 9, should be 27 and for 17 should be 108. You can get an input from user and convert it to an integer using a = int(input('Please enter an integer:')).arrow_forwardWrite a program that prints multiples of a number in* descending order on a single line. The program prompts* the user for the multiple as well as the start value.** Type of loop-> do-whilearrow_forwardWrite a program that asks the user for the price of several items sold until the user answers with an “N”. The program should accumulate the total of all prices entered. After the loop is finished, the program is to compute the sales tax of all items as 7% [0.07]. Finally, the program is to print out the total of the items, the sales tax due, and the total amount due on three separate lines.arrow_forward
- Write a program using do-while loop that: Asks the user to enter a number between 0 and 99 (inclusive). If the number is not valid, then it should continue asking the user for a valid numbr If the number entered is valid, then use a for loop to print a countdown from the number entered down to 0.arrow_forwardWrite a program that inputs the miles driven and the gallons used for multiple trips and displays the miles per gallon value for each trip. Use a sentinel value (such as -1) to stop entering new value. The while loop must iterate as long as the miles entered by the user is not_1.arrow_forwardQuestion 2: Write a program to read student ID and check whether it is odd/even number. Output a 4X4 badge if the student ID is even number and output a 3X3 badge if it is odd number. The badge is built up by the (height X width) of asterisks. (Use for-loop to draw the asterisks, do not hard-coded)arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr