Area Calculator: Prompt the user to enter two choices 1 or 2. If user enters 1 then ask him for length of side of square and if user enters 2 then prompt for length and breadth of rectangle. In both case the output should be the area of square (case 1) or rectangle (case2). In C++
Q: Guess The Number Game: write a C++ program that will ask the user to guess a secret number randomly…
A: #include<iostream> using namespace std; int main(){ int guess,score_p,score_c,random,i;…
Q: Multiple Choice: In the following code, how does the value of x or y change after exeCuting public…
A: While doing programming in any programming language, you need to use various variables to store…
Q: Body Mass Index (BM) is a measure of health on weight. It can be calculated by taking your weight in…
A: Here is the java code. See below step for code.
Q: What is the output from the following code segment if the user enters 8
A: According to the question we need to find the output from the following code segment if the user…
Q: Description Write a program that asks the user to enter an amount of money in the format of dollars…
A: Program: # Asking for a dollar and cent amount from the user # Prompting a message to enter a amount…
Q: Part B: Chore Bonus Your parents pay you $3 for each trash bag full of leaves you rake. If you can…
A: According to the information given:- We have to follow the instructions mentioned to get the desired…
Q: Randomly generate a number. If this number is in range [1, 12], map it to a month name and display,…
A: I have provided JAVA CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: (Geometry: great circle distance) The great circle distance is the distance between two points on…
A: The Java program is written where it takes the latitude and longitude degrees from the user for the…
Q: Programing Language: C++ Your time machine is capable of going forward in time up to 24 hours. The…
A: #include <iostream>#include <iomanip> using namespace std; int computeDifference(int…
Q: c++ programming if…else and switch case are types of conditional selection statements used in many…
A: All the questions are coded in C++.
Q: ACE balloon shop sells balloons to customers at 10 Fils cach. If the customer buys 500-1000…
A: Please find the answer below :
Q: Write a program to calculate electricity charges for a customer. The program requests a name,…
A:
Q: (Cost of driving) Write a program that prompts the user to enter the distance to drive, the fuel…
A: Since, the programming language is not mentioned, below is the complete c++ program:
Q: Write a C program that allows the user to enter values for the width and length of a wall in feet…
A: The required C program should generate a paint calculator in the output. It needs user input for the…
Q: C++ Angle Calculator Write a program that asks the user for an angle, entered in radians. The…
A: C++ Angle Calculator Write a program that asks the user for an angle, entered in radians. The…
Q: USING C++ PROGRAMMING LANGUAGE A mobile phone service has three different data plans for its…
A: Given Plans are: PLAN A: For $19.99 per month, 2 gigabytes are provided. Additional usage…
Q: Nice Number Programming: Nice program ask user to enter three integers from keyboard (java console),…
A: Below is the required java program. Program Approach: Import necessary packages to get the standard…
Q: Mars hyper market gives discount to customers based on their spending. If a customer spends 20 Omani…
A: #include<iostream>using namespace std;int main(){ float spending; cin>>spending;…
Q: In C++ (Find the number of days in a month) Write a program that prompts the user to enter the…
A: Answer: This is my answer: But the complier reported: 1. Compiler error : fatal error 2. #include 3.…
Q: Medication dosage by weight A machine administers medication dosage based on weight. Write an…
A: According to the question given:- we have to create program for Medication dosage by weight For that…
Q: code for this in C: In college, a student may get a grade of 1.0 (as the highest) to 5.0(lowest).…
A: PROGRAM CODE: The challenge is how to use the supplied formula to highlight the final grade, and…
Q: Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight…
A: Below I have provided Java Programming. Also, I have attached the screenshot of the code and output…
Q: switch statement C++ that will loop the case
A: A switch statement allows a variable to be compared against a list of values for equality. Each…
Q: Types of charges Room charges : Junior suite Deluxe suite Executive suite Critical care units:…
A: Since you have posted a question with multiple sub-parts, we will solve first three subparts for…
Q: Exercise 4: Temperature Humidity (H) Weather (T) 16 20 Cold 22 40 Normal 35 75 Hot Write a C++…
A: CODE #include<iostream>using namespace std; int main(){ int temp, hum; cout << "Enter…
Q: ACE balloon shop sells balloons to customers at 10 Fils each. If the customer buys 500-1000…
A: As per the requirement program is completed in c++. Algorithm: Step 1: Write the main() method Step…
Q: Complete the following program When a machine reads blood pressure from a human body it displays two…
A: C++ pass by reference: Pass by reference is the type of calling the function with the address of…
Q: (Apartment problem) A real estate office handles , say, 50 apartment units. When the rent is, say,…
A: PROGRAM: //Header file #include <iostream> #include<iomanip> //Using namespace using…
Q: Write a program that randomly generates a lottery between 100 and 999 (random.randint(100, 999)),…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: program that reads an integer sum in dollars and displays how many dollars bills of $100, $50, $20,…
A: program that reads an integer sum in dollars and displays how many dollars bills of $100, $50,…
Q: 5. (Algebra: solve 2 x 2 linear equations) You can use Cramer's rule to solve the following 2 X 2…
A: Input the numbers from the user, split the number and convert them into float. unzip the list item…
Q: Your program will prompt the user for the following information: current population number of…
A: 1) Below is python program to prompt the user for population, birth death and years to predict…
Q: using namespace std; int main () { int x = 3; if (!x) if (x = 4) cout << "AAA"; else cout << "BBB";…
A: Code is given:
Q: Q7-Write a program that simulates a simple calculator. It reads two integers and a character. If the…
A: // Always mention the language of the program, for now, I am doing it in C++ // Code #include…
Q: Question: ACE balloon shop sells balloons to customers at 10 Fils each. If the customer buys…
A: Given: Write a C++ program to read no. of balloons to purchase and print the amount of bill in BD.
Q: atures of the water. The formula to compute the energy is Q = M * (finalTemperature –…
A: Code: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: Guess the number Write a C program that plays the game of "guess the number" as follows. Your…
A: Answer : I have provided c code with comment which will be easily understood the code : I have…
Q: C++ OOP Write a program that prompts the user to input a length expressed in centimeters. The…
A: Program plan: Prompt for the centimeter value Converts the centimeter length to inch lengthInch…
Q: Car sales commission problem - For each used car a salesperson sells, the commission paid is as…
A: As per our policy, we can answer only one question if want an answer for the second question you can…
Q: C# Question Write a statement that declares a variable words and initialize it to the following…
A: Here is the statement that declares a variable words and initialize it to the following list of…
Q: Day Calculation Background - Many times one needs to do calculations on dates. Programs like Excel…
A: Program Description : The C++ program prompts the user to enter day, month, and year values from the…
Q: Problem Description: The bird of paradise called the Helipixsal is renowned for its magnificent tail…
A: lengths of feathers looping conditions output Explanation: The code is: def main(): num_feathers =…
Q: Q3. Write a C program that displays the menu shown in the example run, to the user, with the…
A: C-programming is a general-purpose,procedural,imperative computer programming language.
Q: 1- If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: The C programming language is a computer programming language that was developed to do system…
Q: Write a C++ program to estimate your water bill for next quarter. Your water meter measures the…
A: #include <iostream>#include <cmath> using namespace std;int maxallo = 50; //declaring…
Q: The greatest common divisor, also known as GCD, is the greatest number that will, without a…
A: HI, Since you did not mentioned language i used 'C'
Q: [Question Description] Enter any number of integers with three digits and determine whether they are…
A: Below is the complete solution with explanation in detail for the given question about palindrome.…
Q: g. the C++ statement/s that declares your variables
A: Variable: The data object whose value can be changed by the user, statement, or expression…
Q: Write a program that prompts the user to enter the edges of a triangle and compares them. If all…
A: In the solution of given problem, we need to use Else-If ladder statement to test the conditions. An…
Q: The Fibonacci sequence is: 0, 1, 1, 2, 3, 5, 8, 13, … The first two terms are 0 and 1, and each term…
A: Introduction of the Program: The C++ program takes the value of the Fibonacci index as input from…
Area Calculator:
Prompt the user to enter two choices 1 or 2. If user enters 1 then ask him for length of side of square and if user enters 2 then prompt for length and breadth of rectangle. In both case the output should be the area of square (case 1) or rectangle (case2).
In C++
Step by step
Solved in 4 steps with 3 images
- C ++ Demonstration: Write a program that prompts the user to input three positive angle values in degrees to determine which type of triangle it is (acute, right, obtuse). TEST CASES: If a user inputs three valid angle values: Enter the first angle in degrees: 60 Enter the second angle in degrees: 30 Enter the third angle in degrees: 90 Result: You have a right triangle! If a user inputs any negative angle values: Enter the first angle in degrees: 45 Enter the second angle in degrees: 55 Enter the third angle in degrees: -80 Result: Error! Please input a positive angle value. If a user inputs values whose sum exceeds 180: Enter the first angle in degrees: 20 Enter the second angle in degrees: 70 Enter the third angle in degrees: 100 Result: Error! It is not a triangle.In C++ (Find the number of days in a month) Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2012, the program should display February 2012 has 29 days If the user entered month 3 and year 2015, the program should display March 2015 has 31 daysC++ Demonstration: Write a program that computes the equivalent resistance of a purely series and purely parallel electric circuit. TEST CASES: If the user inputs a character: Computing for the equivalent resistance A. Series CombinationB. Parallel Combination Enter Choice: B Enter R1: 1 Enter R2: 2 Enter R3: A The value of R3 is not a number. If the user selects “Series Combination” and inputs numbers: Computing for the equivalent resistance A. Series Combination B. Parallel Combination Enter Choice: A Enter R1: 1 Enter R2: 2 Enter R3: 3 The total resistance in series is 6 Ohms.
- 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.Using c++ Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, the following data should be entered: Charges for hospital services (lab tests, etc.) Hospital medication charges Use a single, separate function to validate that no input is less than zero. If it is, it should be reentered before being returned. Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the total chargesCourse Management Teaching Assesment ePortfolio Mahara Course search Helpdesk Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program should also offer the option to display the rectangle. The main flow of the program is given as follows: red 20.00 The user should input the length and width of a rectangle. The user can decide to display the drawing of the rectangle or not. If user indicate yes, execute user's decision. • Display the calculated area, perimeter and diagonal of the rectangle. The program should repeatedly ask if the user wants to process another rectan- gle. Your program should include two functions with the following function prototypes: void drawRec(int length, int width); A function that display a full rectangle with +'. void calcRec (int a, int b, int area, int perim, float diag); A function that returns the area, perimeter and diagonal through pointer parame- ter. Sample output: Enter the length and width of a rectangle: 4 8
- CODE USING C++ Problem: Create a program that will let the user input his/her name and gender. If the user is male, prompt the user to choose team: Jaguar, Eagle or Crocodile. If the user is female, prompt the user to choose team: Barbie, Prada, Payless. The output should display in a sentence form the name and the selected team of the user. Expected Sample Output: Enter Name: DarylEnter Sex: FemaleChoose your team (Barbie, Prada or Payless): barbieYour name is Daryl and you choose to be in Team Barbie.Q1:- From the given figure, write a program in C++ LANGUAGE to read the height of cylinder then calculate the volume and the side area of cylinder in the case that the height of all cylinders is greater than or equal to 4.9955 cm according base radius r height h to these rules: Volume = height the base area ii. Side area = i. %3D base height the base perimeter Suppose the number of cylinders is 500In C++ Programming, write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Social Security Tax: 5.75% Medicare/Medicaid Tax: 2.75% Pension Plan: 5% Health Insurance: $75.00 Your program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your output to have two decimal places. A sample output follows: Bill Robinson Gross Amount: .......................... $3575.00 Federal Tax: ................................ $ 536.25 State Tax: .....................................$ 125.13 Social Security Tax: ................... $ 205.56 Medicare/Medicaid Tax: ......... $ 98.31 Pension Plan: .............................. $ 178.75 Health Insurance: .......................$ 75.00 Net Pay: ....................................... $2356.00 NOTE: The first column is left-justified, and the right column is…
- using c++ Write a program that computes and displays the charges for a patient's hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: The number of days spent in the hospital The daily rate Hospital medication charges Charges for hospital services (lab test, etc.) The program should ask for the following data if the patient was an out-patient: Charges for the hospital services (lab test, etc.) Hospital medication charges The program should use two functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges.Guess The Number Game: write a C++ 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++ Total Purchase A customer in a store is purchasing five items. The prices of the five items are: price of item 1 = $15.95 price of item 2 = $24.95 price of item 3 = $6.95 price of item 4 = $12.95 price of item 5 = $3.95 Write a program that holds the prices of the five items in five variables. Display each item’s price, the subtotal of the sale (total price of five items without tax), the amount of sales tax, the total. Assume the sales tax is 7%, define it as a named constant in your program.