• Write a program that computes the average of 5 students grades which are entered by the user.
Q: - Write a program to compute the mass flow rate of a fluid (in kg/sec) through a thermal unit…
A: Dear learner , Hope you are doing well , I will try my best to answer this question. Thank You!!
Q: Exercise 3. Use the program shell below to implement a program called SumDigits. When completed,…
A: #include <iostream>using namespace std; int main(){ int counter; //loop-control…
Q: 2. Write a program which takes names of five countries as input and prints them in alphabetical…
A: c program which takes string as a country name takes 5 string and then output countries name in…
Q: (B)The following is a list of 20 exam scores. Write a computer program to calculates the average…
A: Python Program:- n=int(input("Enter the number of elements to be inserted: "))a=[]for i in…
Q: I need help in writing a program below Write a program to read doing integers A and B and swap…
A: Hello Student. Warm welcome from my side. Hope you are doing great. As you have not mentioned any…
Q: How many lines of output will be displayed on the screen after the following program is executed?
A: In this question, we are asked to give the correct output of given below code: int main(){ int i…
Q: 2. Write a program to print the Result of Final exam of 25 students in a class. Accept the name and…
A: INTRODUCTION: Here we need to create a flowchart of the result of the final exam of 25 students in a…
Q: 1. What is the order of calculations in the conversion of a temperature? Write an ordered list of…
A: Note :- As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: Write a program that computes and assesse the tuition fee of the students in one semester, based on…
A: Algorithm: 1. Start. 2. Read the tuition fee as tuition_fee. 3. Read payment mode (Press (1) - Cash,…
Q: 4. Write a program that takes data one line at a time and reverses the words of the line. For…
A: Source Code: #include<stdio.h>#include<string.h> /* Program that reverses the words in…
Q: The below program will run without any errors
A: Since value of y is entered as string and value of x will entered as integer because of int…
Q: 4. Write a program that prompts the user to enter a greeting and a name. The program should output…
A: The above program makes use of Scanner class defined in java.util package. This class takes in user…
Q: "Write a program that computes the amount of calories burned when you run. Your program should ask…
A: Algorithm: 1. Take input as duration,speed,weight. 2. Initialize MET to 0. 3. Make MET=8 if speed is…
Q: Suppose that the tuition for a university is $10,000 this year and increases 5% every year. Write a…
A: NOTE: SINCE THE LANGUAGE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define Main class.…
Q: What will be the value of a, b, c after the execution of the followings int a=5, b=7, c=111; c =++a…
A: The values of a, b, and c after the execution of given statements are: a: 6 b: 6 c: 2
Q: What is the execution of the following code? What is the execution of the following code? What is…
A: As, per the guidelines we are allowed to solve 3 parts please upload other parts seperately…
Q: 9. Write a program that inputs two real numbers then exchanges their values. 10. Make a program that…
A: 9 Solution
Q: Write a program to calculate the percentage of the given student in CBSE board exam his marks from…
A: here in this we have to write a program which take five input from user and find percentage
Q: Write a program whose inputs are three integers, and whose output is the smallest of the three…
A: Since the coding language is not mentioned, I have done the code in C++. Algorithm : Step 1 :…
Q: Write a program that shows the following output
A: #include <stdio.h> int main(){ // prompt user for input printf("enter n=\n"); int n;…
Q: (b) Below is part of a code, consider this program and show where each part of code is saved in the…
A: Given: Below is the part of a code , Consider this program and show where each part of code is…
Q: Write a program that converts minutes to days, hours and minutes. The program output should be as…
A: Algorithm: Start Initialise min, d, h, m print input minutes Read the value of minutes d =…
Q: Write a program to read to read basic salary and allowance and display the total salary. (Total…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: 9) Write a program that reads a temperature value and the letter C for Celsius or F for Fahrenheit.…
A: According to the question below the solution: Output:
Q: 13. Write a program that lets the user play Rock-Paper-Scissors against the computer. There should…
A: Since no programming language is mentioned, I am using python Algorithm: Start Read input from user…
Q: 9) Write a program that takes in the user's name and age. Then displays his/her name's initial…
A: #include<iostream> using namespace std; int main() // main function { string name,…
Q: What will be the output of the below program:
A: Output of the above code is in step2.
Q: Write a program that, given the time duration of a task in the number of hours, minutes, and…
A: I have provided c++ code in step2
Q: Write a program to ask user to enter the marks of two subjects of student and calculate the gpa.…
A: Program Approach - Define the main function and declare the variables as per need. Prompt user to…
Q: 8. Write a program that will determine the salary of an employee based on his or her rank as…
A: Use an if-else if ladder to check the rank and print respective salary
Q: 3. A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B,…
A: Ans: Code: score = int(input("Enter the exam score:"))if score > 90 and score < 100:…
Q: Write a program which repeatedly reads numbers until the user enters "done". Once "done" is entered,…
A: As per the question statement, We will run this code and try out different input value and will…
Q: Consider the program below, what is the output of the code when the value of x = 10?
A: The answer is
Q: In python, create a program, "change.py", that has a function that takes 4 arguments that correspond…
A: We assume A penny is worth 1 cent A nickel is worth 5 cent A dime is worth 10 cent A…
Q: Determine the output of the following program: int main() int x=3,y=4,z=6; int *p1,*p2,*p3; p1=&x;…
A: Requirement- Determine Output of Following program Solution- Pointer variables store the address of…
Q: Create a program that reads a duration from the user as a number of days, hours, minutes, and…
A: Start Take the input of number of days, hours, minutes, and seconds. Read the input values. Compute…
Q: Write a program to read to read basic salary and allowance and display the total salary. (Total…
A: #include <iostream> using namespace std; int main(){ int…
Q: Write a program to read the ticket numbers from the user and display the number after free the…
A: Code: #include <iostream>using namespace std;int main(){ cout<<"\nEnter the number of…
Q: 2. Write a program that accepts a numerical value x from 0 to 100 as input and computes and displays…
A: Actually, program is a executable software that runs on a computer.
Q: Modif
A: NOTE: Programming language is not mentioned, so doing in C++ In this question, we are asked to print…
Q: Task 8 Write Python code of a program that reads an integer, and prints the integer if it is a…
A: Given:
Q: Write a program that reads the 10 student grades () from keyboard and calculates the class average.
A: Code in python programming language #Program to read grades of 10 students from teh keyboard and…
Q: Task 13 Write a Python program that takes a number and tells how many digits are in that number.…
A: Program description: n is the user input integer variable that stores the value of the number. count…
Q: Task 12 Write a Python program which takes a number and prints the digits from the unit place, then…
A: Program description: n is the user input integer variable that stores the value of the number.…
Step by step
Solved in 3 steps with 1 images
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows: If the number of rooms booked at least 10, the discount is 10%; at least 20, the discount is 20%; and at least 30, the discount is 30%. Also if rooms are booked for at least three days, then there is an additional 5% discount. Write a program that prompts the user to enter the cost of renting one room, the number of rooms booked, the number of days the rooms are booked, and the sales tax (as a percent). The program outputs the cost of renting one room, the discount on each room as a percent, the number of rooms booked, the number of days the rooms are booked, the total cost of the rooms, the sales tax, and the total billing amount. Your program must use appropriate named constants to store special values such as various discounts.Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds the smallest number and ey
- Phyton In the United States, fuel efficiency for vehicles is normally expressed in miles-pergallon (MPG). In Canada, fuel efficiency is normally expressed in liters-per-hundred kilometers (L/100 km). Use your research skills to determine how to convert from MPG to L/100 km. Then create a program that reads a value from the user in American units and displays the equivalent fuel efficiency in Canadian unitsPrimary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, the 405 services the 5, and the 290 services the 90. Your program will prompt the user to type a highway number ("Please enter a highway number, Ex: 65: "), read in the number typed by the user, and print out whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also your program must indicate if the (primary) highway runs north/south or east/west, that it is an invalid number if not between 0 and 999. Ex: If the input is: 90 the output is: The 90 is primary, going east/west. Ex: If the input is: 290 the output is: The 290 is auxiliary, serving the 90, going east/west. Ex: If the input is: 0 the output is: 0 is not a valid interstate highway number. #include <iostream>using…Guess The Number Game: write a program that will ask the user to guess a secret numberrandomly generated by your program between 1-10. Player have 3 trials to guess the number.After each trial, you have to inform the user, either he/she has guessed it correctly or not, andthe remaining trials to guess the number. In each trial your program should generate a newrandom number. If user guess at least twice correctly, then shows the message, “you won by 2-1” and vice versa for losing.When game is over, ask the user to play again: If the user types "yes", the game start again.else stop the game.
- C++ Write a program that prompts the user to enter the number of students and each student's name and score. and finally displays the name and score of the student with the highest score and the average score.(Display a pattern) Write a program that displays the following pattern:JJ aaa v vaaaJ J aa v v a aJ aaaa v aaaastoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”
- stoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”Notice that the expression on the right side of the formula above will force thecompiler to convert everything to type double. Use type double for your workingvariables. Write your program so that it is able to produce the following screendisplay:Sample session:Enter your speed (in mph): 60.0Enter your tailgate distance (in feet): 240.0Major wreck!The great circle distance is the distance betweentwo points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographicallatitude and longitude of two points. The great circle distance between the twopoints can be computed using the following formula:d = radius X arccos(sin (x1) X sin(x2) + cos(x1) X cos(x2) X cos(y1 - y2))Write a program that prompts the user to enter the latitude and longitude of twopoints on the earth in degrees and displays its great circle distance. The averageradius of the earth is 6,371.01 km. Note you need to convert the degrees into radiansusing the Math.toRadians method since the Java trigonometric methods useradians. The latitude and longitude degrees in the formula are for north and west.Use negative to indicate south and east degrees. Here is a sample run: Enter point 1 (latitude and longitude) in degrees: 39.55 −116.25 ↵EnterEnter point 2 (latitude and longitude) in degrees: 41.5 87.37 ↵EnterThe distance between the two points is…(Find future dates) Write a program that prompts the user to enter an integer for today’s day of the week (Sunday is 0, Monday is 1, …, and Saturday is 6). Also prompt the user to enter the number of days after today for a future day and display the future day of the week.