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.6
Q: Write a java program that uses nested for-loops to display a sequence of numbers. The program should…
A: Program:- import java.util.*;public class Main{ public static void main(String[] args) {…
Q: Write a program that takes in information for three students. For each student get the student ID…
A: Hi. Let's move on to the code in the next step. I have included explanation in comments in the…
Q: Write a C program that determines and prints the date of the Easter Sunday for a given year. You can…
A: Step 1 : Start Step 2 : Declare the local variables to store the Year and the calculated Date., and…
Q: Write a C program using loops that reads an integer grades of students, finds the maximum of them,…
A: #include<stdio.h> int main(){ int a[1000]; int n=0; float sum=0; int x;…
Q: Write a C program that prompts the user to enter a positive integer between 100 and 9999 inclusive).…
A: Logic: - first check the range of input number. then count the number of digits if(count==3)…
Q: Write a pseudo code for a program that will implement the following decision table in Table 2. The…
A: Given table contains, two columns that are Grade point and class of Degree. Read the Grade point…
Q: Make a program that asks for random integers, positive or negative, and sums up all the negative…
A: Coded using C language.
Q: Problem: Write a Java program that displays all the leap years, 10 per line, from 1001 to 2100,…
A: Below is the required code in java language. Program Approach: Define a main class. Inside the…
Q: The State Department of Motor Vehicles (DMV) has asked you to write a program that grades the…
A: Program Plan:- Initialize all the header files. Ask the user to enter the values of n candidates…
Q: Write a C++ program that calculates the due amount for a cellular telephone bill. The cell company…
A: Here is the c++ code: See below step for code:
Q: Write a program that reads an unspecified number of integers and finds the ones that have the most…
A: GIVEN: Write a program that reads an unspecified number of integers and finds the ones that have the…
Q: Below is an IPO program which allows the user to find out how many Euros she will get for a given…
A: //Required C++ code given below :
Q: PRG12: Write a program that will simulate the Paper, Rock, Scissors game. Two players should be able…
A: ## As no language is mentioned, we write the code in Python language. print("\n\n…
Q: Q1:A, B, C are three positive numbers (A<=B<=C). Given a list of seven numbers which are made of A,…
A: Answer
Q: Loops question. Write a C program that reads an integer k from the user and then prints the…
A: The main objective of the C program, main. c is to prompt the user to enter a value and read the…
Q: Write a C program that reads the exam data for each student in a line to be entered from the…
A: According to the Question below the Program: Program Output:
Q: Write a program to create the following figure by using nested for loops. Please assign the number…
A: The below code is fully functional and is written keeping in mind the requirements mentioned in the…
Q: a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn,…
A: It is defined as a kind of object oriented programming language. It is also known as extension of C…
Q: // write a program in C ++ that prints the numbers as follows using a loop. 1 2 3 4 5 1 2 3 4 1 2 3…
A: Procedure Followed: Include Header files. Start the main method. Declare variable 'n' and…
Q: In this c++ program you are asked to design a 2 x 2 x 2 Rubik's cube that is filled with numbers…
A: Given: In this c++ program you are asked to design a 2 x 2 x 2 Rubik's cube that is filled with…
Q: Write a C++ program that finds either a user given number is Armstrong or not. If it is Armstrong…
A: Below is the required C++ program: - Approach: - Include the header file and use the namespace.…
Q: Write a java program that uses nested for-loops to display a sequence of numbers. The program should…
A: Code: import java.util.Scanner; public class MainClass { public static void main(String[] args) {…
Q: Write a C program that reads the exam data for each student in a line to be entered from the…
A: Given: Write a C program that reads the exam data for each student in a line to be entered from the…
Q: Write a C++ program that uses the following for loop: for ( int i = 0; i < e; i++ ) { for ( int j…
A: Logic: e indicates number of rows f indicates number of columns The table represent current row *…
Q: Write a FORTRAN90 program that reads a student ID and his GP he program should print a message…
A: 1- In this assignment require, two input studentID, GPA, and display output according to them using…
Q: Write a program in Python, in which the user can enter any number of positive and negative integer…
A: print("Counting the number of positive and negative values entered by the user!\n") positive =…
Q: Write a C program to assign passengers seat in an airplane. Assume a small airplane with seat…
A: Sample Response: //C program to assign passengers seat in an airplane//Required header files#include…
Q: Write a C++ program to input an upper bound and separate even & odd from that limit? for example i…
A: #include <iostream>using namespace std;int main(){ int upper,i,j=0,k=0; int…
Q: Consider the following code segment. What is the value of i and sum2 after the for loop…
A: Here, "for" loop executes 4 times because condition is less than 5. Initially, "sum2" is zero and…
Q: Write a c program that ask user to insert continously until and then prints the count of even and…
A: Programming Approach: define the header file. using the main()method. declaring variables. the loop…
Q: Write a C++ program called Fibonacci to display the first 20 Fibonacci numbers F(n), where…
A: Program code: //include the required header files #include <iostream> using namespace std;…
Q: You are required to develop a program that calculates the overtime pay of the staff in ABC Company.…
A: We have to calculate total wage and based on hours worked and wage per hour We can implement this…
Q: Write a program that uses do...while loops to perform the following steps: Prompt the user to input…
A: Let us consider a C++ program that uses do.. while loops to perform the following steps: Prompt the…
Q: Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by…
A: user_input = input(); #input temperatureshourly_temperature = user_input.split(); #split…
Q: . Write a c++ program that tells what coins to give out for any amount of change from 1 cent to 99…
A: Programming instructions: Declare the required variables. Use a do-while loop that allows the user…
Q: Write a simple program in C++ that lets the user input a single integer n where 1 ≤ n ≤ 100000. The…
A: C++ program to solve the given problem. A screenshot of output and code is also attached below.
Q: Write a program that reads a positive integer x from the user. If x is even, the program prints all…
A: logic:- declare x do { read positive number if x<0 display error message } while (x<0); if…
Q: Write a program using for loop that generates a multiplication table for any integer (given by the…
A: 1) Below is python program that generates a multiplication table for any integer upto multiple times…
Q: Write a C program that reads the income of a person and calculates his total tax according to the…
A: C Program for above : #include <stdio.h> int main() { double salary; //get the…
Q: Write a program in C# that gives counts/number of vowels and consonant inputted by the user. Take…
A: Introduction of Program: The C# program takes a number of characters from the user and then the…
Q: Write a c++ program for a bank in your town that updates its customers’ accounts at the end of each…
A: Objective: This program implements the Bank account problem in which the user inserts values for his…
Q: Write a program that uses two nested for loops and the modulus operator (%) to detect and print all…
A: Dear Student, As no programming language is mentioned I am assuming it to be c++.
Q: A program to convert letters to their corresponding telephone digits. Write a Java program that will…
A: EXPLANATION: - The Scanner class is present in the util package. It is imported to read the user…
Q: write a c++ program that asks user to enter a number and then print the number that is maximum time…
A: #include<iostream> using namespace std; int main(){ int n, x, max_count=0; cout…
Q: Write a complete C++ program that simulates rolls of a die. • The program will prompt the user for a…
A: Use srand() for generating various random numbers with respect to current time which generates…
Q: Write a C++ program that calculates the due amount for a cellular telephone bill. The cell company…
A: Below I have provided C++ Programming. Also, I have attached the screenshot of the code and output…
Q: Write a C++ program that ask user to insert numbers continuously until and then prints the count of…
A: Solution with detail explanation using c++ comments:- #include <iostream> using namespace std;…
Q: Write a program that uses loops to collect data and calculate the average score over a number of…
A: use nested loop and 2D array store[i][j] where i denotes number of students and j denotes number of…
Q: Write a program in C# that gives counts/number of vowels and consonant inputted by the user. Take…
A: // Please post one question at a time, for now I am providing solution for first one only. Thank You…
- 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.6
Step by step
Solved in 4 steps with 2 images
- Write a program that creates the multi-panel plot shown below, for Planck curves at 4 different temperatures Planck Curves Use embedded noninteractive plotting and set the figure size to be 10x5 inches. • You may write your program in a single cell, or break it over multiple cells. Use a logarithmic x axes, and the logspace() function for generating the axes values. You will have to be careful with units on this one. For 50% extra credit have your program use a loop over the four axes, with all the plotting code contained within the loop (except for any subplot adjustments). 0.030 12 300K 1000K 0.025 10 0.020 FBBX (Wm-nm-1) FBBA (Wm-2nm-¹) 0.015 10 0.010 0.005 2 0.000 A (nm) λ (nm) 100000 3000 3000K 6000K 2500 80000 2000 60000 FBBA (Wm-2nm-¹) FBBX (Wm-2nm-1) 1500 40000 1000 20000 500 0 101 102 0 101 103 104 105 106 102 103 104 105 106 X (nm) λ (nm) python languageCan you write a new code in C ++ language with the values I sent you, just like this output? There are two files named group1.txt and group2.txt that contain course information and grades of each student for each class. I will calculate each course average for each group and show in simple bar graph. Use "*" and "#"characters for group1 and group2, respectively. I will see the number -999 at the end of each line in the input files. This value is used for line termination and you can use it to verify that you have arrived at the end of the line. The averages of each group should also be calculated and printed at the end of the file. All of the results will be printed to the file. There will be no screen output. Sample output is shown in Figure 1. Group 1: CSC 80 100 70 80 72 90 89 100 83 70 90 73 85 90 -999ENG 80 90 80 94 90 74 78 63 83 80 90 -999HIS 90 70 80 70 90 50 89 83 90 68 90 60 80 -999MTH 74 80 75 89 90 73 90 82 74 90 84 100 90 79 -999PHY 100 83 93 80 63 78 88…Write a C++ program that uses the following for loop: for ( int i = 0; i < e; i++ ) { for ( int j = 0; j < f; j++) cout << *(*(b+i) + j ) << “\t”; cout << endl;} To print the following multiplication table: 1 2 3 4 5 6 7 8 92 4 6 8 10 12 14 16 183 6 9 12 15 18 21 24 274 8 12 16 20 24 28 32 365 10 15 20 25 30 35 40 45 In your program, it is given that e = 5 and f = 9.
- Write a program in C++ that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A loop should then iterate once for each floor. In each iteration, the loop should ask the user for the number of rooms on the floor and how many of them are occupied. After all the iterations, the program should display how many rooms the hotel has, how many of them are occupied, how many are unoccupied, and the percentage of the rooms that are occupied. The percentage may be calculated by dividing the number of rooms occupied by the number of rooms. Note: It is traditional that most hotels do not have a thirteenth floor. The loop in this program should skip the entire thirteenth iteration. Solve the problem by using a single loop that iterates once for each floor between 10 and 16 and, on each iteration, ask the user to input the number of suites occupied on that floor. For less than 0 floors it should read an error. Use a nested loop…Write a program in C++ that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A loop should then iterate once for each floor. In each iteration, the loop should ask the user for the number of rooms on the floor and how many of them are occupied. After all the iterations, the program should display how many rooms the hotel has, how many of them are occupied, how many are unoccupied, and the percentage of the rooms that are occupied. The percentage may be calculated by dividing the number of rooms occupied by the number of rooms. Note: It is traditional that most hotels do not have a thirteenth floor. The loop in this program should skip the entire thirteenth iteration. Solve the problem by using a single loop that iterates once for each floor between 10 and 16 and, on each iteration, ask the user to input the number of suites occupied on that floor. Use a nested loop to validate the value entered is between 0 and…Write a program in C++ that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A loop should then iterate once for each floor. In each iteration, the loop should ask the user for the number of rooms on the floor and how many of them are occupied. After all the iterations, the program should display how many rooms the hotel has, how many of them are occupied, how many are unoccupied, and the percentage of the rooms that are occupied. The percentage may be calculated by dividing the number of rooms occupied by the number of rooms. Note: It is traditional that most hotels do not have a thirteenth floor. The loop in this program should skip the entire thirteenth iteration. Solve the problem by using a single loop that iterates once for each floor between 10 and 16 and, on each iteration, ask the user to input the number of suites occupied on that floor. For less than 0 floors it should read an error. Use a nested loop…
- Write a program in C that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests the bingo card for a winner via 2 users Steps: 1- Ask user 1 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 2- Ask user 2 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 3- Design 2 BINGO cards as you see below 4- Distribute the numbers onto the 2 cards with each user input with 0 in the middle 5- Display the 2 cards in 1 screen as you see below 6- Generate a random number between 10-40 no duplicates / check for range and repetition 7- Compare the random number with the numbers on the 2 cards 8- If the random number matches any number on each card, change the number on the card to 0 9- Check for winning cards 5 numbers in a row or column = 0 5 numbers in a diagonal = 0 all 4 corners of the card = 0 if any of the players won, display who is the winner and exit the program if the 2 players won, display both are…Loops question. Write a C program that reads an integer k from the user and then prints the multiples of 1 up to k, the multiples of 2 up to k/2, etc. For k = 10, the printout would be 1,2,3,4,5,6,7,8,9,10, 2,4,6,8,10 3,6,9 4,8 5,10,Write a program in C++ that asks the user for a positive integer value. The program should use a loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1, 2, 3, ..., 50. Also the starting number cannot be negative. I have attached how the output should appear.Thanks so much for your help!
- Write a C++ program that accepts a positive integer (orstring) as input and then displays a new number obtained by replacingevery pair of repeated adjacent digits by a single digit. For example,the integer 558834226 has three repeated adjacent digits: 55, 88 and 22.This means that your program should display the integer 583426 insteadof (558834226). You may assume that no digit is repeated more than twice.In this lab, you add a loop and the statements that make up the loop body to a C++ program that is provided. When completed, the program should calculate two totals: the number of left-handed people and the number of right-handed people in your class. Your loop should execute until the user enters the character X instead of L for left-handed or R for right-handed. The inputs for this program are as follows: R, R, R, L, L, L, R, L, R, R, L, X Variables have been declared for you, and the input and output statements have been written. Instructions Ensure the source code file named LeftOrRight.cpp is open in the code editor. Write a loop and a loop body that allows you to calculate a total of left-handed and right-handed people in your class. Execute the program by clicking the Run button and using the data listed above and verify that the output is correct. **GIVEN CODE** #include<iostream> using namespace std; int main(){ string leftOrRight = ""; // L or R for one…In this lab, you add a loop and the statements that make up the loop body to a C++ program that is provided. When completed, the program should calculate two totals: the number of left-handed people and the number of right-handed people in your class. Your loop should execute until the user enters the character X instead of L for left-handed or R for right-handed. The inputs for this program are as follows: R, R, R, L, L, L, R, L, R, R, L, X Variables have been declared for you, and the input and output statements have been written. Instructions Ensure the source code file named LeftOrRight.cpp is open in the code editor. Write a loop and a loop body that allows you to calculate a total of left-handed and right-handed people in your class. Execute the program by clicking the Run button and using the data listed above and verify that the output is correct. **CODE GIVEN** // LeftOrRight.cpp - This program calculates the total number of left-handed and right-handed //…