Problem 1. Construct a Flowchart Diagram, Pseudocode and write a C++ program that applies bonus scores to given scores in the range [1.9]. The program reads a digit as an input. If the digit is between 1 and 3, the program multiplies it by 10; if it is between 4 and 6, multiplies it by 100; if it is between 7 and 9, multiplies it by 1000. If it is zero or if the value is not a digit, the program must report an error. Create two program versions, one that uses a switch statement and the other one uses nested if-else statement and at the end print the calculated new value in the console.
Q: Develop a C Program to calculate the basic salary of 5 employees where the hourly rate and the no.…
A: Given: Develop a C Program to calculate the basic salary of 5 employees where the hourly rate and…
Q: Write a program in C language using switch case statement to evaluate the following formulae and…
A: use switch case for branching expression calculation.
Q: 1. Create a flowchart and C++ program of the following problem: The manager of a football stadium…
A: To construct above program , we have taken number of ticket sold of type premium as to be np number…
Q: Write a program in C to print a diamond using *. Ask the use to input the height of the pyramid.…
A: Please find the answer below :
Q: e) How can you write a C++ program to read input two numbers p,q and then display the minimum value…
A: Write a C++ program to read input two numbers p,q and then display the minimum value of p and q in…
Q: Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program…
A: The program is written to call two functions from main. Depending on whether the user wants to draw…
Q: Write a c program to compile a frequency distribution and evaluate moment such as mean , standard…
A: Sample Response: //C program to compile a frequency distribution and evaluate such as mean, variance…
Q: create a flowchart and a c++ program that will compute the real state tzx, given the following…
A: EXPLANATION: - The variables of type double are declared and initialized as: - double…
Q: iv) Write a C++ program to input the three dimensions(in ft) of a cuboid-shaped room from the user…
A: The total surface area is painted and the two sides has to be printed The total surface area of a…
Q: Problem 4: Write a C program to input cost and selling price of a used car and check after selling…
A: Code #include<stdio.h> int main() { int cp,sp,x,y; scanf("%d", &cp);…
Q: Write a C program that uses the statements in Exercise 3.6 to calculate x raised to the ypower. The…
A: Here we have variable x and y and we need to calculate xy
Q: You have to create a program in C language in which the user enters the mass m and radius & of a…
A: Moment of inertia of a disk about its axis perpendicular to the plane - MR^2/2 M=mass R=Radius
Q: Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program…
A: Note: Comments mentioned in code for understandability. Code: #include<iostream> #include…
Q: Develop a C++ code which asks user to enter a value. The value entered could be of any data type.…
A: #include <type_traits>#include <typeinfo>#ifndef _MSC_VER# include…
Q: Write a c++ program which take initial velocity, time, distance and final velocity as input and…
A: The below given C++ program will obey the following rubrics: Including necessary header files. In…
Q: 1. Write a program for asking for a quiz score. The program then will display a remark if FAILED or…
A: Required: (use C++ program) Note: Write the defining diagram first, the solution (written either in…
Q: Problem – 4: Write, compile, and run a C++ program to perform one of the following tasks for the two…
A: Here the program calculating the slope of line formed by the two points Start input two points…
Q: 1. Create a flowchart and C++ program of the following problem: The manager of a football stadium…
A: #include <iostream> using namespace std; int main(){ int pr,b,s,ga;…
Q: Problem 4: The list price of a scientific calculator is 100 dollars. If you get a price discount of…
A: According to the Question below the Solution: As per our guidelines we are supposed to answer?️…
Q: Example 1: Write, compile and execute a C++ program using while loop statement to print your name…
A: I have provided solution in step2.
Q: Create a C++ program that computes for the area of a triangle using one function prototype,…
A: Code #include <iostream>using namespace std;double area_of_triangle(int b,int h);double…
Q: i) Write a C program to input your student ID, and GPA from keyboard and display with headings.…
A: Programs: Programs contain certain lines of code, that contain the instructions. The instructions…
Q: The slope m of a straight line that passes through two points P1(x1, y1) and P2(x2, y2) is…
A: Algorithm : main function() Step 1 : declaring a variable of type ifstream. Step 2 : using the…
Q: c) How can you write a C++ program to read input two numbers p,q and then display the maximum value…
A: Write a C++ program to read input two numbers p,q and then display the maximum value of p and q in…
Q: Code, compile and execute a C++ program that accepts the x and y coordinates of two points. The…
A: Read the value of x1 and x2 and the value of y1 and y2 . Find the value Xm and Ym by using the…
Q: c) How can you write a C++ program to read input two numbers p,q and then display the maximum value…
A: Write a C++ program to read input two numbers p,q and then display the maximum value of p and q in…
Q: 1.8 Create a C++ program in which the user enters the work done W by a force and the time taker and…
A: The power is defined as the work done per unit interval of time
Q: Please write a c++ programming code that can work on codechum according to the instructions below.…
A: Coded using C++.
Q: 1- write a c program to process weekly employee time cards for all employees of an organization…
A: As per the guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: Draw a FLOWCHART and WRITE a C program to measure the surface area and volume of a sphere and a…
A: Flow chart
Q: Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program…
A: Given length and width, the program need to calculate area,perimeter and diagonal. Based on the user…
Q: Problem Statement Consider two locations, an origin and a destination, on the globe identified by…
A: #include<stdio.h>#include<math.h> //main methodint main(){double…
Q: The circuit above represents a non-inverting amplifier with input, V₁ and output, V₁. A dc lamp,…
A: Program Plan: Initialize Vl, Il, R1 and R2. Declare Rl, flag, and ratedCurrent to 220, false, and…
Q: In C, and please use SIGPIPE. DO NOT repost an existing answer! a) Design a small program in which…
A: Answer :
Q: Write a C++ program that is used to calculate the Sine function using the rel below: X- 3! Where x…
A: main logic:- for(i=1;i<=n;i+=2) { p=1; factVar=1; for(j=1;j<=i;j++) { p=p*x;…
Q: You have to create a program in C language in which the user enters the mass m and radius of a…
A: Coded using C language.
Q: Design, write and compile, and run a C++ program to convert temperature in degrees Fahrenheit to…
A: Write a program using C++ language which takes an input(temperature in fahrenheit) and convert it…
Q: Create a c program that evaluates a quadratic function x^2 +5x +6. The main program will call a…
A: Program description: The main.c C program objective is a prompt user to enter the x value. Then the…
Q: PROBLEM 5. Write a C++ program that would output the following series numbers. OUTPUT: 1, 2,…
A: Here we have given a series , i.e. 1, 2, 4, 7, 11, 16, 32, 39, 47, 56, 66We have asked to write C++…
Q: 3) Write a C++ program that stores the variable length and the variable width. Have your program…
A: Algorithm: 1. Start. 2. Read the value for length and width variable. 3. Calculate the value for…
Q: REATE A C++ PROGRAM THAT THE USER WILL INPUT 2 COORDINATES TO REPRESENT A LINE IN A CARTESIAN PLANE…
A: Algorithm: Start Read x1,x2,y1,y2 values If y2-y1 is 0, print "VERTICAL LINE" Else if x2-x1==0…
Q: Problem 2: When a particular rubber ball is dropped from a given height (in meters), its impact…
A: Algorithm: step1: take height and g value from user(for both moon and earth case separately)…
Q: Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Write a C++ program to compute for the magnitude and direction of the resultant of 2…
A: Requirement- To write a c++ to calculate resultant of two forces. Algorithm- Rx = Acosα + Bcosβ…
Construct a flowchart diagram, pseudocodes and write a C++
Step by step
Solved in 5 steps with 1 images
- (General math) a. Design, write, compile, and run a C++ program that calculates and displays the area of a triangle, such as the one in Figure 2.18, with a base of 1 in and a height of 1.5 in. The area is given by this formula: Area=12(base)(height) b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to determine the area of a two-dimensional triangle with a base of 3.5 in and a height of 1.45 in.(General math) a. Write a C++ program to calculate and display the value of the slope of the line connecting two points with the coordinates (3,7) and (8,12). Use the fact that the slope between two points with the coordinates (x1,y1)and(x2,y2)is(y2y1)/(x2x1). b. How do you know the result your program produced is correct? c. After verifying the output your program produces, modify it to determine the slope of the line connecting the points (2,10) and (12,6). d. What do you think will happen if you use the points (2,3) and (2,4), which results in a division by zero? How do you think this situation can be handled? e. If your program doesn’t already do so, change its output to this: The value of the slope is xxx.xx The xxx.xx denotes placing the calculated value in a field wide enough for three places to the left of the decimal point and two places to the right of it.(General math) Write, compile, and run a C++ program to calculate the distance between two points with the coordinates (7, 12) and (3, 9). Use the fact that the distance between two points with the coordinates (x1, y1) and (x2, y2) is given by this formula: distance=(x2+y2) After verifying that your program works correctly by calculating the distance between the two points manually, use your program to determine the distance between the points (-12, -15) and (22, 5).
- (General math) a. Write, compile, and run a C++ program to compute and display the value of the second-order polynomial ax2+bx+c for any user-entered values of the coefficients a, b, c, and the variable x. Have your program display a message to inform users what the program does, and then display suitable prompts to alert users to enter the data. (Hint: Use a prompt such as Enter the coefficient of the x-squared term:.) b. Check the result of your program written for Exercise 7a by using the following test data: Testdataset1:a=0,b=0,c=22,x=56Testdataset2:a=0,b=22,c=0,x=2Testdataset3:a=22,b=0,c=0,x=2Testdataset4:a=2,b=4,c=5,x=2 After finishing your verification, use your program to complete the following chart(Program) a. Write a C++ program to display the following output: The cosecant of an angle is equal to one over the sine of the angle. b. Compile and run the program you have written for Exercise 6a.(General math) a. Design, write, compile, and run a C++ program to calculate the volume of a sphere with a radius, r, of 2 in. The volume is given by this formula: Volume=4r33 b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to determine the volume of a cube with a radius of 1.67 in.
- (Electrical eng.) The amplification of electronic circuits is measured in units of decibels, which is calculated as the following: 10LOG(Po/Pi) Po is the power of the output signal, and Pi is the power of the input signal. Using this formula, write, compile, and run a C++ program to calculate and display the decibel amplification, in which the output power is 50 times the input power. Verify your program’s result by doing a hand calculation. After verifying that your program is working correctly, use it to determine the amplification of a circuit, where output power is 4.639 watts and input power is 1 watt.(Electrical eng.) a. The voltage gain of an amplifier is given by this formula: voltagegain=[275 23 2 +0.5 f 2 ]n f is the frequency in Hz. n is the number of stages in the amplifier. Using this formula, write, compile, and run a C++ program to determine the value of the voltage gain for a four-stage amplifier operating at a frequency of 120 Hz. Your program should produce the following display: At a frequency of xxxxx hertz, the voltage gain is yyyyy Your program should replace xxxxx with the frequency and yyyyy with the voltage gain. b. Manually check the value your program produces. After verifying that your program is working correctly, modify it to determine the voltage gain of a 12-stage amplifier operating at a frequency of 9500 Hz.(Hydraulics) a. Write, compile, and run a C++ program to calculate the horizontal force exerted on the T-connector pipe shown in Figure 2.16 when the mass flow rate is 1.5 kg/s, and the fluid’s velocity entering the T-connector is 3 m/s. The formula for determining this force is as follows: Fh=MfvFhisthehorizontalforce(N).Mfisthemassflowrate( kg/s).visthevelocity( m/s)ofthefluidenteringthepipe. Your program should produce the following display (replacing the xxxx with the actual force value your program calculates): The horizontal force, in Newtons, is xxxx b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to calculate the force exerted when the mass flow rate is 2.3 kg/s, and the velocity of the fluid entering the pipe is 4.25 m/s.
- General math) a. Write a C++ program to calculate and display the midpoint coordinates of the line segment connecting the two endpoints given in Exercise 1a. Use the fact that the coordinates of the midpoint between two points with the coordinates x1,y1)and(x2,y2)are((x1+x2)/2,(y1+y2)/2). Your program should produce the following display (replacing the underscores with values your program calculates): ThexmidpointcoordinateisTheymidpointcoordinateis b. How do you know the midpoint values your program calculates are correct? c. After verifying the output your program produces, modify it to determine the midpoint coordinates of the line connecting the points (2,10) and (12,6). d. If your program doesn’t already do so, change its output to this: The x coordinate of the midpoint is xxx.xx The y coordinate of the midpoint is xxx.xx The xxx.xx denotes placing the calculated value in a field wide enough for three places to the left of the decimal point and two places to the right of it.(Conversion) a. Design, write, compile, and run a C++ program to convert temperature in degrees Fahrenheit to degrees Celsius. This is the equation for this conversion: Celsius=5.0/9.0(Fahrenheit32.0) Have your program convert and display the Celsius temperature corresponding to 98.6 degrees Fahrenheit. Your program should produce the following display (replacing the underlines with the correct values): For a Fahrenheit temperature of ___ degrees, the equivalent Celsius temperature is ___ degrees. b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to convert 86.5 degrees Fahrenheit to its equivalent Celsius value.(Physics) a. Design, write, compile, and run a C++ program to calculate the elapsed time it takes to make a 183.67-mile trip. This is the formula for computing elapsed time: elapsedtime=totaldistance/averagespeed The average speed during the trip is 58 mph. b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to determine the elapsed time it takes to make a 372-mile trip at an average speed of 67 mph.