You are required to write a C++ program to determine the number of students based on their weight range. First, the user must input the total number of students in the class. Next, by using looping, the user need to input the weight, in kilogram (kg), for each of the students. The program should display error message if the user input invalid weight. The program should produce the output according to the following format: Range(kg) Number of Students Below 40 ? 41 – 60 ? 61 – 80 ?
Q: Write a program that mimics a calculator. The program should take as input two integers and the…
A: logic:- Define 5 functions i.e add, sub, mul, division, display. First four functions will take a…
Q: Q1:- From the given figure, write a program in C++ LANGUAGE to read the height of cylinder then…
A: Program code: // include the required header files #include<iostream> using namespace std; //…
Q: You’re given coins of different denominations and a total amount of money. From that, you need to…
A: In this problem, we were given the coins of different denominations and a total amount of money is…
Q: For the series circuit shown, V; the voltage drop, across resistor, across resistor R2, and the…
A: The inputs will be E, R1 and R2 Firstly we will calculate the I and the V2 and then P2
Q: You are required to produce a C++ program which solves the following: 1- A worker is paid according…
A: Given that You are required to produce a C++ program which solves the following:1- A worker is paid…
Q: A chemical sensor works to read the value of pollution in four industrial sites every four hours a…
A: Required: write a program in C ++ language that works to read the pollution values in those sites…
Q: Write a program that, given a number of hours, calculates the number of weeks, days, and hours…
A: Question 1 : Algorithm : Step 1 : declaring and initializing the variables. Step 2 : ask for…
Q: Write a C++ program that calculates and prints the monthly paycheck for an employee. The net pay is…
A: Find the required code in C++ given as below and output:
Q: I'm currently studying C++ and i have this lab i need the answer to it. Write a program that asks…
A: CODE:- #include <iostream>using namespace std;int main(int argc, char *argv[]){ int quarters,…
Q: Write a C++ program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of…
A: 1. declare quantity, discount. 2. get User input 3. Calculate percentage using above table using if…
Q: Writing a Modular Program in C++ BadDate.cpp 19 // This is the work of the housekeeping() method //…
A: The program is written in C++. Please find the program code and flowchart in the below steps.
Q: Write a C++ program that displays a table of speeds in kilometers per hour with their values…
A: Given, The formula for converting kilometers per hour to miles per hour:…
Q: I want to solve the question in c++ please Modify your program to make the user enter a quantity…
A: #include <iostream> using namespace std;int input(){ int n; cin>>n; return n;}…
Q: In C++, if the statement ( int a-5, b=2: ) is written at the beginning of the program, then the…
A: I HAVE PROVIDED THE ANSWERS FOR ALL 10 QUESTION 1.ElectricalEng2.4.53.char h='all';4.unsigned5.5…
Q: Q3 Write a C++ program to find the sea wave speed (c) for the rang of water depths {0,5,10,15,20…
A: Algorithm: Start Set PI=3.14 Set g=9.81 Read L Read d Compute: k = L/(2*PI) IF (d/L)<0.05: c…
Q: Question 2: Write a C program that asks the user to enter several amounts of water consumed in cubic…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: You are required to produce a C++ program which solves the following: A worker is paid according to…
A: C++ code :- #include <iostream> using namespace std; int main() { int…
Q: I want to solve the question in c++ Exercise 5 Part1: • Write a program that presents to the…
A: Find the required code given as below and output :
Q: In C++ Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and…
A: Here I have taken input from the user. Then I have calculated the cost in dollars for 20, 75, and…
Q: Task 3: Here is a program that computes the number of miles that light will travel in a specified…
A: Please check the step 2 for required code and step 3 for output with code screenshot.
Q: You are writing a program for a scientific organization that is trying to determine the coefficient…
A: Q: Code the given problem
Q: Write a c++ program that calculates the cost of 3 bags of fruit. The 4 possible fruits are pears…
A: i hope it will work for you #include<bits/stdc++.h>#define INF 1000000using namespace std;…
Q: Write a c++ program that prompts the user to enter the length and the width of a rectangle. The…
A: C++ is one of the most popular programming language developed by Stroustrup at Bell Labs. The basic…
Q: The force of gravity is different for each planet of the nine planets in our solar system. For…
A: Program Code: #include<iostream>using namespace std;main(){ float weight,n_weight; char ch;…
Q: 1. Write a program in C which is a Menu-Driven Program to compute the area of the various…
A: Note that there were no restriction stated hence made this way. I have created both the program. I…
Q: Employees in a company receives net salary after the deductions for tax, Staff Provident Fund (SPF),…
A: - We will take the input salary - We will apply the conditions as requested - Calculate the actual…
Q: A company selling household appliances gives commissions to its salesman determined by the kind of…
A: Program: #include <stdio.h> int main() { int…
Q: You have been given 10 body temperatures of 10 individuals. Write a C# program that reads these body…
A: Algorithm: 1] Initilialise an array which stores the body temperatures of 10 people. 2] Display the…
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: Here, first you need to declare some variables for all salaries. Then prompt user to enter basic…
Q: A company selling household appliances gives commissions to its salesman determined by the kind of…
A: A flowchart is a pictorial representation of an algorithm. It is a graphical representation of steps…
Q: You are required to produce a C++ program which solves the following: 1-A worker is paid according…
A: Code #include <iostream>using namespace std;int main(){ string name; //for input user…
Q: Q3. Write a C program in which the user can enter his/her body temperature in Fahrenheit and the…
A: I give the code in C as per your requirement along with output and code screenshot
Q: Use C++ Write a program that simulates flipping a coin to make decisions. The input is how many…
A: For generating head or tail we had used rand() function. Algorithm- 1) ask number of times coin to…
Q: A dice is an n-sided shape with the sides labelled by numbers 1, 2, dice used to play various games…
A: Answer : SOURCE CODE IN C++: #include <iostream> #include <fstream>…
Q: Q2: Write a program in C++ language to evaluate this equation below? y = x? +-5
A: C++ program to evaluate the equation as given
Q: Jason Hardy opened a coffee shop at the beach and sells coffee in three sizes: small (9 oz), medium…
A: Answer :- #include <iostream> #include <iomanip> using namespace std; //constants…
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: C++ program is given below
Q: Q6: Years that are evenly divisible by 400 or are evenly divisible by 4 but not by 100 are leap…
A: Leap Year Complete Program in Step 2
Q: Write a C program that will calculate the total payment for a brand new car being purchased on…
A: C program: C is a programming language developed by Dennis Ritchie at AT & T Bell Laboratory in…
Q: You are required to produce a C++ program which solves the following: 1- A worker is paid according…
A: PROGRAM CODE: #include <iostream> using namespace std; float calculateTD(float income) {…
Q: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all…
A: #include <iostream>#include <fstream>#include <cmath>#include <iomanip>using…
Q: Task 1: Write a program that will add the marks of a student in Theory and in practical of C…
A: Code: #include <stdio.h>int main(){ //declaring required variables int m1,m2,total;…
Q: The normal selling price of any product is $200. But there is an offer, if the buyer chooses to play…
A: Algorithm: Start Ask user whether she/he willing to play game If yes, generate a random number…
Q: The normal selling price of any product is $200. But there is an offer, if the buyer chooses to play…
A: The random price of scratch card can be generated using rand() function in C++. To generate price in…
Q: write a program in c++ Type equal to 'G', If classification is equal to 5 then set the character…
A: #include <iostream> using namespace std; int main(){ int classification; cout <<…
Q: Modify the craps program to allow wagering inside of C#, and explain each step (reject if you…
A: After updating the code, I have provided C# CODE along with CODE SCREENSHOT and OUTPUT…
Q: Find the attached file.
A: Program Approach: Create variables and take input from user. Store entered values in an array. Ask…
Q: Write a program in C++ that should calculate the insurnace for a house. use questions below to…
A: Algorithm 1. Input all required variables like the first name, last name, no. of people in the…
You are required to write a C++ program to determine the number of students based on
their weight range. First, the user must input the total number of students in the class. Next,
by using looping, the user need to input the weight, in kilogram (kg), for each of the
students. The program should display error message if the user input invalid weight. The
program should produce the output according to the following format:
Range(kg) Number of Students
Below 40 ?
41 – 60 ?
61 – 80 ?
81 – 100 ?
Above 100 ?
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- C++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.In C++, write a program that calculates and prints a monthly paycheck for an employee. The net pay is calculated after taking the following deductions from the employee's gross salary: Federal Income Tax: 17.5% State Tax: 9.1% Social Security Tax: 6.2% Medicare Tax: 1.45% Retirement Plan: 9.29% Health Insurance: $51.48 Life Insurance: $3.71 Your program will prompt the user to input the employee ID, the employee name, and the employee's monthly gross salary. The program will calculate the deductions listed above, along with the percentage of take home pay (defined as the net pay divided by the gross salary). After calculating each deduction and percentage, the output will be printed to the screen (see example output below). Requirements All decimal numbers must be formatted to 2 decimal places. Ask for the employee's ID first, then full name (can include spaces), then the salary. The prompt to enter the salary must include the employee name. The employee ID MUST be…Employees in a company receives net salary after the deductions for tax, Staff Provident Fund (SPF), and Global Insurance (GI): Basic Salary Range ($) Tax Rate SPF GI 0 – 1999 0 % 11 % 1 % 2000 – 2999 5 % 12 % 2 % 3000 – 4999 8 % 13 % 5 % Above 5000 10 % 17 % 8 % Based on the table given, you are required to write a C programming for a system that accepts the employee’s basic salary, and generates the net salary after the respective deductions as described above
- Write a C++ program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of ice costs $2.5, but the price varies with the amount that he purchases. The following table shows the discount that Jacob receives. In your program, define variables with meaningful names to accept user input on order volume, and calculate total ordering cost based on the order volume inputted. Use if-else statements to handle the calculations for different order volumes as shown in the above table. Your program should print out user order volume, discount rate, and total ordering cost in console Order Volume Discount Rate >= 200 bags 25% off 120 - 199 bags 20% off 60 - 119 bags 15% off 40 - 59 bags 10% off 20 - 39 bags 5.5% off 0 - 19 bags No discountModify the craps program to allow wagering inside of C#, and explain each step (reject if you can't). Initialize variable Balance to 1000 dollars. Prompt the player to enter a wager. Check whether the wager is less than or equal to Balance and, if not, have the user reenter the wager until a valid wager is entered. After a valid wager is entered, run one game of craps. If the player wins, increase Balance by wager, and print the new Balance. If the player loses, decrease Balance by wager, print the new Balance, check whether Balance has become zero and, if so, print the message “Sorry. You busted!” (explain steps as much as possible so I can understand plz).The program to modify has the code listed below:// Craps class simulates the dice game craps.using System; class Craps{// create random-number generator for use in method RollDiceprivate static Random randomNumbers = new Random(); // enumeration with constants that represent the game statusprivate enum Status {Continue, Won, Lost}…Write a C program that calculates the price of a pizza and prints the receipt as follows: 1- Your program should first ask the user to enter the size of the pizza (integer value 1=large, 2=medium, 3=small) as well as the number of toppings (integer). 2- Your program should then read the pizza basic price (double) as well as the price of a topping ( float ) from the user. 3- Your program should then calculate the total price of the pizza using the following formula: Total price = ( basic price + number of toppings * topping price ) / size; And print a receipt which displays the details of your pizza order as well as the final total price to the screen
- In C++ Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved by executingcout << fixed << setprecision(2); once before all other cout statements. Ex: If the input is: 20.0 3.1599 the output is: 3.16 11.85 79.00 Note: Real per-mile cost would also include maintenance and depreciation.Jason Hardy opened a coffee shop at the beach and sells coffee in three sizes: small (9 oz), medium(12 oz), and large (15 oz). The cost of one small cup is $1.75, one medium cup is $1.90, and one largecup is $2.00. Write a menu-driven program in c++ that will make the coffee shop operational. Your programshould allow the user to do the following:a. Buy coffee in any size and in any number of cups.b. At any time show the total number of cups of each size sold.c. At any time show the total amount of coffee sold.d. At any time show the total money made.Your program should consist of at least the following functions:1. a function to show the user how to use the program,2. a function to sell coffee,3. a function to show the number of cups of each size sold,4. a function to show the total amount of coffee sold, and a function to show the totalmoney made.Your program should not use any global variables and special values such as coffee cup sizes and cost of a coffee cup must be declared as…The members of the board of a small university are considering voting for a pay increase for their 100 faculty members. They are considering a pay increase of 5%. Write a complete program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase. You have to use a loop for the problem. C++ language only.
- In order for the bulb to work, 3 buttons must be pressed and the button values must provide exactly the required energy, there should be no more or less. It is assumed that the buttons are pressed simultaneously, the order is not important. If the required energy is provided with the entered button values, the program should output "Bulb On", if not, "Bulb Does Not Light" output. Code the program in C language, following the rules below. 1. The number of buttons and their values will be taken from the user.2. The energy required for the bulb to work will be taken from the user.3. You have to design the program RECURSIVE.4. The triple button groups that provide the required energy do not have to be listed, it is sufficient to send a message to the screenNeed help with a C++ program Write a C++ program that helps a person determine how long they can hike for under various conditions on a given supply of water. Your program should prompt the user to enter how much water they can carry in liters. Then, for each of the following conditions, print out how many hours the user can hike for. - moderate temperature, moderate difficulty: 1/2 liter per hour- moderate temperature, high difficulty: 3/4 liter per hour- high temperature, moderate difficulty: 1 and 1/2 liters per hour- high temperature, high difficulty: 1 and 3/4 liters per hour SAMPLE OUTPUT Hello! Welcome to the Hiking Water Calculator!How many liters of water can you carry? 8 OK. Here is how long you can hike for on 8 liters of water under the following conditions: moderate temperature, moderate difficulty: 16 hoursmoderate temperature, high difficulty: 10.6666666 hourshigh temperature, moderate difficulty: 5.3333333 hourshigh temperature, high difficulty: 4.5714285 hours.…Use C++ Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is either heads or tails. Assume the input is a value greater than 0. Ex: If the input is: 3 the output is: heads tails heads For reproducibility needed for auto-grading, seed the program with a value of 2. In a real program, you would seed with the current time. In that case, every program's output would be different, which is what is desired but can't be auto-graded. Note: A common student mistake is to call srand() before each call to rand(). But seeding should only be done once, at the start of the program, after which rand() can be called any number of times. Your program must define and call the following function that returns "heads" or "tails".string HeadsOrTails()