Write a program using a Loop structure that takes Five inputs of sales for item 1 – item 5 from the user during runtime. The program should use Running -Total to calculate the sales.
Q: Write a program to generate the numbers following: a) (-1, 3, -5, 7, -9, 13, -15, 17, -19, 23) on…
A: #include <stdio.h> int main() { int i, j, rows; printf("Enter the number of rows: ");…
Q: Write a program that would generate the following pattern. 0 -1 -1 -1 -1 -1…
A: I created a code in python to print this pattern also give the output screenshot
Q: Write a program using loops to generate following pattern.…
A: Since the question did not specify the programming language the program has been developed using…
Q: Write a program that asks the user to enter today’s sales for five stores. The programshould then…
A: Given:- Write a program that asks the user to enter today’s sales for five stores. The programshould…
Q: Write a program to print the numbers 2 to 10 in increments of two on the same line. The output of…
A: As per our guidelines we are supposed to answer only one question So please post the other question…
Q: 1. Write a program that calculates the squares and aubes of the index values from 0 to 10.…
A: Solution: Approach: Include necessary header files in the main function print the values using…
Q: Four experiments are performed, each producing six test results. The results for each experiment are…
A: Actually, program is a executable software that runs on a computer.
Q: In C++, if the statement ( int a=5, b=2; ) is written at the beginning of the program, then the…
A: In step 2, you can see the program output. In step 3, I will give you the final anwer.
Q: Write pseudocode that prints out 3 offices, with 5 employees each. You must use a nested loop. Your…
A: Note :- You have not mention the language of the program for output , so i'm answering your question…
Q: The university is planning for an industrial visit to an ABC company. The faculty has to create a…
A: The program is written in Python. Check the program screenshot for the correct indentation. Please…
Q: A loop X has a nested loop Y that has another nested loop Z. Z has a print statement. The print…
A: #include <iostream>using namespace std;int main() {int i,j,k; for(i=0;i<2;i++) for…
Q: TASK 5: Write a program with a meaningful loop calculation that uses a parallelized loop. Explain…
A: Step 1 Parallelized loop means, The loop which doesn't depend on the previous loop and all…
Q: Write a program using a Loop structure that takes Five inputs of sales for item 1 – item 5 from the…
A: code snippet:
Q: Write a C++ program that accepts five values of meters, one at a time, and converts each value…
A: do { cout<<"\nEnter value in meter: "; cin >> meter; if (meter<60) {…
Q: write a C++ program. Write a program that calculates the occupancy rate for a hotel. The program…
A: C++ program to calculate the occupancy rate for a hotel. Prompt the user to enter the number of…
Q: Write a program using Nested loops that ask the user to input number of rows from 1 to 13, if the…
A: 1) Since programming language is not specified, I have written program in python 2) Below is program…
Q: Design an interactive input loop that scans pairs of integers until it reaches a pair in which the…
A: If a number to divide the other number evenly, then this number is to be exactly half of other…
Q: Write a loop that runs 10 times and inputs data from the user. That data is added to a running…
A: Step 1: Start Step 2: Declare variables(one for user input and other for running total with initial…
Q: Write a C++ program. A person goes to office three days Friday, Monday and Wednesday in a week. For…
A: Program to display the salary of a person, that goes to office three days a week, for 4 weeks in a…
Q: Write a program that uses nested loops to display the diamond pattern shown below.…
A: z
Q: Create a conditional/looping program problem that will make use of Making selections using ranges,…
A:
Q: python language - Write the syntax for a double nested for loop (with indices i and j go from 0 to…
A: for i in range(23): for j in range(23): if j >= 0 and j <= 3: print(j,…
Q: Write a Python software that prompts the user for the amount of values they wish to join. The…
A: Please find the answer to the above question below:
Q: Create a program using C++ Goto loop that would ask the user to input a number and to input a range.…
A: Logic: Declare variables. Accept number and range from user. Create label for goto statement.…
Q: Write a program to generate a table of conversions from Fahrenheit to Kelvin for values from 0…
A: According to the Question below the Solution: Solution:
Q: Write a nested loop to print all factors of each value from 1 to max inclusive: Example Output (if…
A: #include<iostream>#include<string.h>using namespace std; int main(){ int num1=0; int…
Q: Write an algorithm (pseudo code) for a program that display a person name x times. Use For loop,…
A: 1. For Loop for(i=1;i<100;i++) print "Bartleby"
Q: Write a program using nested for loops to print a star frame. The width and height of the frame is…
A: 1) Below is C++ program using nested for loop to print star pattern based on width entered by user…
Q: A while loop is a form of Select one: a. transitive loop b. definite loop c. indefinite loop d.…
A: The problem is based on the basics of loops in programming languages.
Q: Write a program that display the following output (horizontal graph) using loops. Enter 10 numbers…
A: Read input as string of numbers and then split them to store in a list For each value in list, print…
Q: Write a program that output the following using loops. value of x : 19 value of x : 18 value of…
A: Given: Write a program that output the following using loops. value of x : 19 value of x :…
Q: Write a Basic program to calculate Y value if the condition (Y <0) break the loop and Y equation as…
A: Algorithm: Start Read n value Initialize x and d to 1 Initialize y to 0 Calculate…
Q: write table for the final values of i and x that is generated by the following VB program segment? i…
A: i=0 x=5 Do while(i<=10) if i mod 2=0 then x=x+i i=i+1 Loop
Q: Write a program that use loops to print the following patterns separately, one below the other. In…
A: The C++ code along with the the snapshot of code and output is given below:
Q: Write a program that uses a while loop to determine how long it takes for an investment to double at…
A: Python program is coded in the next step using the while loop.
Q: write a python program that prints a 3 column table showing the circumference and area of ten…
A: Programming approach Import the random module for generating a random radius. Import constant "pi"…
Q: Write a program that prints a 3-column table showing the circumference and area of ten circles of a…
A: We have used random module to get random number. We have taken low integer for random radii and high…
Q: "Program C" 1. Squares Looping random numbers and manipulating those values are fun, too! Why…
A: As given, I need to write a C program that askes user to enter random numbers continuously and print…
Q: C++ PROBLEM Write a loop to print all multiples of 3 from 20 down to 10 inclusive on a single line.…
A: A simple solution is to iterate over all the number in reverse order from high range to lower range…
Q: in python for glass box testing of a while loop, you should test cases where: a) the while loop is…
A: Glass Box Testing. Glass box is a test method that checks the structure of the program and obtains…
Q: Write a program that performs a survey tally on beverages. The program should prompt for the next…
A: use an infinite loop for accepting votes till user enters -1 Finally, number of votes has to be…
Q: Write a program that prints multiples of 9 in descending * order on a single line. * The program…
A: C++ Program for above : #include <iostream> using namespace std; int main() { cout…
Q: Task 02 Find the sum of the following sequence using loops and print the result a.…
A: Actually, Assembly language is a low level programming language. It uses mnemonic codes and labels…
Q: The instructions in a _____________________ loop might not be processed at all, whereas the…
A: Pretest loop: In a pretest loop, the test condition is evaluated before entering the loop. If the…
Q: An electrical manufacturer test five generators by measuring their output voltages at three at three…
A: Given: An electrical manufacturer test five generators by measuring their output voltages at three…
Q: Write a program that prints a 3-column table showing the circumference and area of ten circles of a…
A: Programming language is missing in the question. So we will answer this program in Python. If you…
Do not use functions
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
- Write a program finding the smallest even integer that is divisible by 13 and by 16 whose square root is greater than 120. For that apply a loop structure starting from 1 and stoping when the number is found. The program displays the message "Ilgili sayn: " and then displays the number.Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask the user for the number of years. The outer loop will iterate once for each year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period. Add additional loops to validate the input: Do not accept a number less than 1 for the number of years. Continue to prompt the user for a number until a valid number is entered. Do not accept negative numbers for the monthly rainfall. Continue to prompt the user for a number until a valid number is enteredWrite a program that prompts the user to enter a series of strings, but with each string containing a small integer. Use a while loop and stop the loop when the user enters a zero. When the loop has finished, the program should display: the number of user inputs (not counting the final zero input). the total of the integers in the strings entered. the average of the integers accurate to one decimal place.
- All programming languages have a loop capability. Looping is the program logic’s ability to repeat one or more lines of code either: A set number of times, a “for loop” (i.e. 10, 100, 500, 763 or more times) An “unknown” number of times (i.e. loop terminates if a tested condition becomes “true” or as long as the tested condition remains “false”), a “while” loop, a “do until” loop, a “do while” loop. This Lab exercise demonstrates the use of the “For Loop”, a standard loop in all programming languages. C++ standard For Loop format looks like: For (n = 1; n <= 100; n++) { Loop line 1 code; Loop line 2 code; Loop line 3 code; Loop line N code; } The loop code needs: A “loop counter variable” (n in the above example) to keep track of how many iterations this loop has run A starting value (i.e. 1 in the above example) A stop test (i.e. run as…Write a C++ program (using cout and cin) that calculates a student's GPA. Ask the user to enter grade and also the credit hours of the course in a loop until user enter “N” or “n”. Earned points in that course becomes Grade point * credit hours i.e., Earned points = Grade point*credit hours Grade points of each grade are as follows Grade Grade Points A 4 B 3 C 2 D 1 F 0 Example: You got “A” grade in Computer Programming theory course and the credit hours are 3. So your earned grade points=4*3=12 Similarly if you get “C” grade in another subject e.g., Computer Fundamentals and the credit hours are also 3 here. Now earned grade points = 2*3=6 If you get “B” grade in Circuit and Systems theory and the credit hours are 3. So your earned grade points=3*3=9 Now your GPA = (12+6+9) / 9 = 3Write a C++program (using cout and cin) that calculates a student's GPA. Ask the user to enter grade and also the credit hours of the course in a loop until user enter “N” or “n”. Earned points in that course becomes Grade point * credit hours i.e., Earned points = Grade point*credit hours Grade points of each grade are as follows Grade Grade Points A 4 B 3 C 2 D 1 F 0 Example: You got “A” grade in Computer Programming theory course and the credit hours are 3. So your earned grade points=4*3=12 Similarly if you get “C” grade in another subject e.g., Computer Fundamentals and the credit hours are also 3 here. Now earned grade points = 2*3=6 If you get “B” grade in Circuit and Systems theory and the credit hours are 3. So your earned grade points=3*3=9 Now your GPA = (12+6+9) / 9 = 3 GPA formula is: GPA=Sum of earned points in all subjects / Total credit hours
- An electrical manufacturer test five generators by measuring their output voltages at three at three different times. Write a C++ program that uses a nested loop to enter each generator’s test results and then computes and displays the average voltage for each generator. Finally, compute for the total average for all generators. Assume the following generator test results. 1st generator 122.5 122.7 123.0 2nd generator 120.2 127.0 125.1 3rd generator 121.7 124.9 126.0 4th generator 122.9 123.8 126.7 5th generator 121.5 124.7 122.6Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score (display the student’s name and score). Also calculate the average score and indicate by how much the highest score differs from the average. Use a for loop. Test Data: Ben Simmons 70 Carson Wentz 80 Joel Embiid 90 Bryce Harper 75 Redo Problem A. Replace the for loop with a while loopExercise H for the Nested Loop Write a program that would generate the following pattern. 0 -1 -1 -1 -1 -1 1 0 -1 -1 -1 -1 1 1 0 -1 -1 -1 1 1 1 0 -1 -1 1 1 1 1 0 -1 1 1 1 1 1 0
- Write a program that requests the current time and a waiting time as two integers for the number of hours and the number of minutes to wait. The program then outputs what the time will be after the waiting period. Use 24-hour notation for the times. Include a loop that lets the user repeat this calculation for additional input values until the user says she or he wants to end the program. Input Notes:Both the current time and the waiting time are entered in the form HH:MM where HH and MM are integers signifying hours and minutes respectively. In response to the continuation prompts (described below) the user types a y or a Y to signify "continue" with any other character signifying "quit". Output Notes (Prompts and Labels):At the outset the program prints the title "Compute completion time from current time and waiting period". The program then prompts for the current time with the prompt "Current time:" followed by the instructions "Enter 24 hour time in the format HH:MM". After…write a C++ program. Write a program that calculates the occupancy rate for a hotel. The program shouldstart by asking the user how many floors the hotel has. A loop should then iterate oncefor each floor. In each iteration, the loop should ask the user for the number of roomson the floor and how many of them are occupied.After all the iterations, the program should display how many rooms the hotel has, howmany of them are occupied, how many are unoccupied, and the percentage of roomsthat are occupied.The percentage may be calculated by dividing the number of rooms occupied by thenumber of rooms and then multiplying by one hundred.Write a program containing a pair of nested loops that displays the integer values 1–100, ten numbers per row, with the columns aligned. The first line should print out a title that says something like “Practice 5: Practice with nested loops”. There is no input from the user on this problem. A sample output is below.