Ask for and get the length and width of a rectangle (both doubles). As an example, if the user enters 6.2 and 14.95 for the length and width, then the output look similar to:
Q: Suppose you want to remove extra spaces at the begnning or end of a string. Java has the trim()…
A: the program is an given below :
Q: Write a program that uses a loop to ask the user for a number, then to print the first 10 multiples…
A: #include <iostream>#include<conio.h>using namespace std;int main(){ int n,i,t;…
Q: Ask the user for three ints (these can be entered in any order). Then print the values in order from…
A: A required C++ program is as follows, #include <iostream> int main() { //Declare the…
Q: Sorry for not mentioning language. Language is C++, I hope it can be re-written.
A: The given Python program is as follows: def calculate_sum_and_average(numSet): """Calculate the…
Q: 7.17 (Even or Odd) Write expression-bodied method IsEven that uses the remainder operator (8 ) to…
A: PROGRAM EXPLANATION: - The Numbers class comprises of isEven function having bool return type. The…
Q: Classes and operator overloading Define a class for complex numbers. A complex number is a number of…
A: C++ Code:#include<iostream.h> #include<conio.h> class complex { int a,b;…
Q: In the program, you should do these steps: i. ii. Get two values from keyboard (32-bit unsigned…
A: - We have to code for the perimeter problem.
Q: 4. Average Rainfall Write a program that calculates the average rainfall for three months. The…
A: C++ Language Since C++ is portable, it has the potential to create apps that can be customised for…
Q: Computer Science two sites that are beneficial to C# developers. Post the links to the sites and…
A: Please upvote me please. I need it badly. I am providing you the correct answer below. To sites…
Q: Differentiate between C++ and Java.
A: C++ It is a programming language that includes the function of C programming language in addition…
Q: Input: your program should ask the user for the amount of principal, the interest rate as a percent…
A: #include <iostream>#include<math.h>#include<iomanip>using namespace std; int…
Q: b. Write a program for printing the following on output screen : % % % 5555 5555% % % % % % 5555…
A: C++ is one of the most popular programming languages developed by Stroustrup at Bell Labs. The basic…
Q: Owning your own home is a goal for many people. Few of us have the money to buy a home for cash, so…
A: Open visual studio. Select File -> New -> Project. Select Visual C++ -> Console App. Type…
Q: Create an application class named Letter Demo that instantiates objects of two classes named Letter…
A: Here is your solution step by step :
Q: e interesting
A: Creator of the C++ language is: Bjarne Stroustrup C++ is a middle-level programming language used…
Q: Write a simple substitution code for an alphabetic string. That is, declare a permutation of the 26…
A: #include <stdio.h>#define MAX_STR_LEN 256int main(){ char…
Q: Ask the user for a double. Depending on what they enter, print ONE of these two forms: Ex1: Suppose…
A: We have used #include<iomanip> so that we can display specific decimal places as we want and…
Q: b) A 4-ary max heap is like a binary max heap, but instead of 2 children, nodes have 4 children. Á…
A: Programming instructions: Declare the required variables. Initialize the array. Call the…
Q: 4) Write a general program that takes x-y coordinates of a point in the cartesian plane and prints a…
A: The complete code is given below with the output.
Q: Program specifications: Input: your program should ask the user for the cost of the house, the…
A: Program description: The C++ program that prompts the user to enter the cost of the house, down…
Q: Ask the user for two numbers (these can be entered in any order). Then print the numbers, and tell…
A: We are using #include<iomanip> so that we can use specific decimal places as we want. We are…
Q: 2. Write a code which receives a day number (1: Sunday, 2: Monday, 3: Tuesday, etc.) from user and…
A: This question comes from Programing Language in C++ which is a paper of Computer Science. Let's…
Q: 18. Fat Gram Calculator Write a program that asks for the number of calories and fat grams in a…
A: In this question we have to write a C++ code for the Fat gram calculator as per the problem…
Q: Write a program that asks the user for a rectangle's length and width. Then it prints a rectangle of…
A: #include <iostream> using namespace std; int main() { int len,width = 0; while (true)…
Q: Ask the user for two integers and get their values. Then, print the numbers, and tell the user…
A: We have defined 3 variables namely first_number, second_number, and factor. We are taking input…
Q: 9.4 (Duplicate Word Removal) Write a console app that inputs a sentence from the user (assume no…
A: Program:- using System;using System.Linq;public class Program { public static void Main() {…
Q: used Visual Studio C++ and I can only use else or switch cases. C language is not allowed also
A: The answer is
Q: Write a program that will ask the user for 7 integers, then print their total. Note: 1. You must use…
A: A required program is as follows, #include <iostream> int main() { //Declare three…
Q: Prog1 Ask the user for the name of the file to get input from. The data is stored in this form:…
A: Objective: This program reads a file whose name would be entered by the user and the file contains…
Q: Prog5 Ask the user for the name of a file where the data is stored in this form: int int int int…
A: Below is the required C++ program: - Approach: - Import the header file and use the namespace.…
Q: One type of investment is where you make a single deposit (called the principal) and then let…
A: Open visual studio. Select File -> New -> Project. Select Visual C++ -> Console App. Type…
Q: Ask the user for two doubles and get their values. Then print out how far away from 25 (either…
A: Explanation- Declare four variables . Take input of two numbers from user Find the difference of…
Q: Given an array of products ["Apple", “Banana", “Cucumber", “Watermelon", “Ice-cream", “Orange",…
A: using System;class HelloWorld { static void aeiou(string[] my_list) { //function aeiou…
Q: Ask for and get three doubles from the user; the numbers represent the values for a, b, and c that…
A: Roots of a quadratic equation : The roots of a quadratic equation, can be calculated by using the…
Q: One type of investment is where you make a single deposit (called the principal) and then let…
A: Introduction of program The C++ program provided with the Principal, Rate of Interest, Number of…
Hello, I need to solve this problem with C++
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Lab Activity: In python.(This is for devc++ but I use mindmap from Cengage. I know it a little different. If you can't use Cengage, I suggest devc++ version 5.11) One way to determine how healthy a person is, is by measuring the body fat of the person. The formulas to determine the body fat for female and male are as follows: Body fat formula for women: A1 = (body weight X 0.732) + 8.987 A2 = wrist measurement (at fullest point) / 3.140 A3 = waist measurement (at navel) X 0.157 A4 = hip measurement (at fullest point) X 0.249 A5 = forearm measurement (at fullest point) X 0.434 B = A1 + A2 - A3 - A4 + A5 Body fat = body weight - B Body fat percentage = body fat X 100 / body weight Body fat formula for men: A1 = (body weight X 1.082) + 94.42 A2 = waist measurement X 4.15 B = A1 - A2 Body fat = body weight - B Body fat percentage = body fat X 100 / body weight Instructions Write a program to calculate the body fat of a person. Prompt the user to input: Their gender ('m' or 'M' for male, 'f' or 'F' for…Write a program that takes a positive integer as the height of the triangle and prints an alphabetical triangle, using lowercase English letters as shown below. Each subsequent row of the triangle should increase in length by two letters. Make sure your program validates the user input. If the user does not input a positive integer, print "Invalid input."
- : In the classic problem FizzBuzz, you are told to print the numbers from 1 to n. However,when the number is divisible by 3, print "Fizz''. When it is divisible by 5, print "Buzz''. When it isdivisible by 3 and 5, print"FizzBuzz''. In this problem, you are asked to do this in a multithreaded way.Implement a multithreaded version of FizzBuzz with four threads. One thread checks for divisibilityof 3 and prints"Fizz''. Another thread is responsible for divisibility of 5 and prints"Buzz''. A third threadis responsible for divisibility of 3 and 5 and prints "FizzBuzz''. A fourth thread does the numbers.Write a program that reads the employee's name and base salary and then calculates the tax and net amount Salary where: Net salary = Basic salary If the basic salary is less than 500 (no tax) Net salary = basic salary - tax value So that the tax amount is 5% of the basic salary Then it prints the employee's name and net salary %3D 2:40 PM /user_num1 and user_num2 are read from input. If user_num1 is less than 0, output 'user_num1 is negative'. If user_num2 is greater than 8, assign user_num2 with 5. Otherwise, output 'user_num2 is less than or equal to 8'. Click here for examples ● 1 user_num1 = int(input()) int(input()) 2 user_num2 = 3 | 4 user_num int (input) 5 user_num2 int (input 0) 6 if user_num1 8: 9 user_num2 = user_num2-5 10 else: 11 print (user_num2 is less than or equal to 8') 12 print('user_num2 is', user_num2)
- (This if for mindtap on cengage, if not possible, use devc++ 5.11 but mindtap is more accurate, mindtap is very tricky with wording so please make sure everything is word for word on the sample picture) Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate’s name (Candidate), the number of votes received (Votes Received), and the percentage of the total votes received by the candidate (% of Total Votes). Your program should also output the winner of the election. Your program must contain at least the following functions: a function to determine the sum of votes. a function to output the winner of the election.Write a program that receives an integer from the user and prints Large if that number is greater than or equal to 100, prints average if that number is between 20 and 100, and prints Small if that number is less than or equal to 20. You can get an input from user and convert it to an integer using a = int(input('Please enter an integer:'))The area of a hexagon can be computed using thefollowing formula (s is the length of a side): Write a program that prompts the user to enter the side of a hexagon and displaysits area. Here is a sample run: Enter the side: 5.5 ↵EnterThe area of the hexagon is 78.59
- Write a program that reads 6 integers and displays the largest and the smallest amongst those integers.Write a program that prompts the user to enter an integer anddisplays whether the integer is an odd number or not. Here are the sample runs: Enter an integer: 200 ↵Enter200 is even number Enter an integer: 211 ↵Enter211 is odd numberWrite a program that asks you to input an integer. After you input the integer, it should ask if you want to input another integer. If you answer y, it should allow you to input a second integer and then output the sum of the two integers you entered. If you answer n or some character other than y, it should output the integer you input before. For example: if you input 4, answer y and then input 3, it should output 7 if you input 4 and answer n, it should output 4