Give meaningful identifiers for the following variables and write a proper C++ declaration and initialization to a reasonable value. a. A variable to store the letter grade, (A, B, C, D, or F).b. A variable to store the sales tax price of an item.c. A variable to store the number of juice bottles sold.d. A variable to store the billing amount of a doctor’s visit.e. A variable to store the grade point average (GPA).
Q: Q6): what are the output result for the following statements: { int X, Y = 1; For (X-0;X< 60 ; X+= 3…
A: Here I written C++ code with given code snippet with explanation. I hope you like it.
Q: Q1/A chemical sensor works to read the value of pollution in four industrial sites every four hours…
A: Required: Code to get the pollution reading every day in every 4 hours. and find the pollution rate…
Q: 1. In order to discourage excess electric consumption, an electrical company charges its customers a…
A: flowchart for problem 1 calculate electric bill
Q: Can you rewrite the following C++ code using the Switch statement instead of the If statement? int…
A: Step-1: Start Step-2: Input a integer A Step-3: switch statement and pass A Step-3.1: case '$' :…
Q: State which of the following are true and which are false. If false, explain your answer.c) The…
A: Answer of the given question: The given statement is False The given statement will just print a=…
Q: e the following C++ code and determine the output. .5 + static_cast (7.4)/2; << x; ane of these
A: Here x is of integer data type
Q: What will be printed when the following C code is executed? #include int main() { if('A'<'a')…
A: Answer: The Char variable has an ASCII value of its own. The characters are thus compared according…
Q: What is the value of A after the execution of the following C code. #include main() { int A=5,a=2;…
A: Option C: There is error in code.---> It is the correct option. The explanation is given below:
Q: Give meaningful identifiers for the following variables and write a proper C++ declaration and…
A: A variable is any qualities, number, or amount that can be estimated or counted. A variable may…
Q: State the order of evaluation of the operators in each of the following C statements andshow the…
A: Answer of the given question: Here is the step by step solution of every question: Answer (a) x = 7…
Q: C++ Have the user input a Float (ex: -15.750) and the output must display the following: Float…
A: c++ program to input the float value and print it into IEE 754 representation.
Q: Write a program c++ that prints the letter A instead of the number 65, without using variables or…
A: Sample Response: //C++ program to print A without using any variables#include<iostream>using…
Q: THE QUESTION IS BELOW WITH OUTPUT AND INPUT. AND I HAVE PROVIDED MY ANSWER AND COMPILER ERROR…
A: Required: THE QUESTION IS BELOW WITH OUTPUT AND INPUT. AND I HAVE PROVIDED MY ANSWER AND…
Q: What is the output of the following C++code? int x = 15; int y = 3; if (x + y > {y = x -x = y…
A: The given code contain several syntax error: int x = 15; int y = 3; if (x + y > { //error 1y =…
Q: The following C program includes an error. Which line of the following code causes the error?
A: The given code is: #include<stdio.h>#include <time.h>int main(){ double init_pose =…
Q: Write a c program that prints: - Your name - Your e-mail address - Your High School - Home town -…
A: Variable definition: A name given to a memory address to store data values is called a variable.…
Q: First Aid are asked. Passing grade in driver's license exams is 70 out of 100. A student who scores…
A: // t refers traffic, e refers engine, f refers first //aid print("Enter the traffic wrong…
Q: Comment on the output of the following C code.
A: In this code no error is there
Q: I am trying to write a code in C++ to output the sum of the square of the odd numbers between 2 user…
A: The program is written in c++
Q: Declare all variables of double type and then translate the following equation to a C++ statement.…
A: The given mathematical equation contains the below functions sin, log. The functions for sin and log…
Q: Write C++ statement(s) to accomplish each of the following tasks: (i) Declare 2 integer variables, x…
A: C++is an operating system which is an open source. It is a software which helps in managing the…
Q: Examine the following C++ code and determine the output. int x; x = 7.5 + static_cast(7.4) /2; cout…
A: Given Program, #include <iostream> using namespace std; int main() { int x; x =…
Q: In C++, choose the incorrect way to write the following condition? yx)||(y<z)) III. (y<x)&&(x<z))
A:
Q: Write a single C statement or line that accomplishes each of the following:d) Input three integer…
A: The answer is...
Q: Write a C program to find the result of the following formula with the following conditions. a, b…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: What is the output of the following C code when the user enters 2 from the keyboard?
A: Since x = 2 then case 2 will run and print "1" and there is no break so it will print "2" also.
Q: Q2: Write C++ statements to do the following:
A: Array indexing starts from 0 and last value is null To access any value, we do it using indices In…
Q: Do it correctly What will be the output of the following C++ code? #include using…
A: Question. What will be the output of the following C++ code? #include <iostream>…
Q: Write single C statements that f) Increment variable i by 1.
A: Here in this question we have asked to write a c statement that increment variable i by 1 .
Q: a) Explain the purpose of using loops, what are the types of loops in C++, write down their syntax,…
A: Here, I have to provide a solution to the above question.
Q: Write two distinct C++ statements that will decrement a variable n by nine.
A: #include <iostream> using namespace std; int main(){ int n = 20; cout<<"Old Value…
Q: Write C++ statements for the following arithmetic expressions. Assume A, B, C, D, X, Y, and Z are…
A: A * C B * D ----------- + -----------…
Q: As a programmer, you are asked to develop a C program using if...else statements or switch…
A:
Q: Fill in the blank with appropriate C++ statements in order to display the output as shown below: 8:…
A: I have highlighted the statements with Red colour
Q: Write a C statement to accomplish each of the following tasks.e) Print "The sum is: " followed by…
A: Answer: Approach 1. Declare the variable sum 2. Ask user to enter the value of sum 3. Scan the input…
Q: B. Your Computer Science assigned a task to you. Your task is to develop a C program to read a…
A: As per the company guidelines we are supposed to answer only one question. Algorithm Step 1: Start…
Q: b) Rewrite the following C program and do the following modifications. Replace Switch-Case statement…
A: Define header file <stdio.h> for io operations. Define main function. Define int variable…
Q: Point out the errors if any in the following part of the program in c++ void main() { int…
A: void main() { int a=30; f(); // function call } void f() //function definition { int b=10;…
Q: What is the output of the following C++ code? int num 63B cout << (num + 5) / 2;
A: Given num = 6, where num is an integer value Given expression (num+5)/2
Q: What will be the output of the following C code? #include int main() { - 1; if (a--) int a =…
A: Given, Code: #include <stdio.h> int main() { int a = 1; if (a--)…
Q: What will be the value of i after the C statements at the right have been executed? i - 3; (j = 10;…
A: Given c statements i=3; j=10; if((3*i)<j) i=i+2; i=i+3; i=?
Q: 2. Construct a program where you deciare and initialize a constant variable, now try to reassign…
A: EXPLANATION: The constant variables are basically those variables which can not be modified at the…
Q: Y USING C++, SOLVE THE FOLLOWING QUESTION. Based on the coding attached, further modify the C++…
A: Q: Code the given problem.
Q: You and your friend are going into the café to eat the food. When you reach the destination, you…
A: C++ program to calculate bill for the counter is in step 2.
Q: What will be the output of the following C++ code: int main o int x. Y, 1=2 y=7: 1>y)?:y cost <<…
A: bool Explanation:- bool is a predefined keyword to declare Boolean datatype variables.
Give meaningful identifiers for the following variables and write a proper C++ declaration and initialization to a reasonable value.
a. A variable to store the letter grade, (A, B, C, D, or F).
b. A variable to store the sales tax price of an item.
c. A variable to store the number of juice bottles sold.
d. A variable to store the billing amount of a doctor’s visit.
e. A variable to store the grade point average (GPA).
Trending now
This is a popular solution!
Step by step
Solved in 5 steps
- In C Declare a variable of type double.Ask the user for a value and place it in the declared variable.Write code to check for and output statement stating whether the variable is zero, positive, ornegative.Write C assignment statements for the following: a. Assign a value of 0 to a variable called between if n is less than -k or greater than +k; otherwise, assign 1. b. Assign a value of 1 to a variable called divisor if digit is a divisor of num; otherwise, assign a value of 0. c. Assign a value of 1 to a variable called lowercase if ch is a lowercase letter; otherwise, assign a value of 0.2- Write a C+ program that calculates the area of a Rectangleif the user inserts R' or Y, and the area of a Triangle if the user insert T or ", using the following formulas: RectangleArea-Height*Width; Triangle Area-0.5* Base *Height; Where the values of the base, height, and width inserted by the user from the keyboard. Please choose the shape type: "R' or 'r' to calculate the Area of a Rectangle, T'or 't' to calculate the Arca of a Triangle R Please insert the height of the Rectangle: 10 Insert the width of the rectangle: The Area of the Rectangle is: 50 Piease choose the shape type: "R'or 'r' to calculate the Area of a Rectangie, T or 't' to calculate the Area of a Triangle Please insert the base of the Triangle: 10 insert the height of the Triangle: The Area of the Rectangle is 10 Spring 2021
- C++ Have the user input a Float (ex: -15.750) and the output must display the following: Float Number (what the user inputted), Sign (If the user inputted a positive or negative Float), Whole (binary), Fractional, Exponent, Mantissa and IEE 754. NO library functions like atoi. These are the steps that I have so far: Input a Float Check if Float is Pos or Neg -> store 0 or 1 (and then make it positive to make it easier) Split the float into whole (int) and fractional (float) Convert whole number into binary (if whole == 0) like (0.1231), then just store 0 into the binary Convert fractional to binary Find exponent bias Convert exponent bias to binary Create the mantissa Create IEE754 (the whole thing) OUTPUT: Float Number: Sign: Whole (Binary): Fractional: Exponent: Mantissa: IEE 754:C++ write a program that calculates and prints the take-home pay for commissioned sales employee. Allow user to enter value for the name of employee and the sales amount for the week. Employee receive 7% of the total sales. Federal tax rate is 18%. Retirement contribution is 10%. Social Security tax rate is 6%. Use appropriate constantsGET THE C++ CODE 1. A student took four quizzes in a term and would like to compute their average. He also would like to know what will be the remarks. Follow the range of grades and its equivalent remarks, and then fill-up the table below: 100-95 - Excellent 94-90 – Very Satisfactory 89-85 - Satisfactory 84-80 - Fine 79-75 - Fair 74 and below – Poor Answer the following: What statement in the program that determines that the average is passing? What was the condition applied to satisfy the requirement? What have you observed in using if-else statement in this program? What have you observed in using nested if statement in this program?
- C++ Coding Question: A car's odometer tells you how far (in miles) you traveled. Each number is displayed in its own “window” and the odometer counts up when you drive. Write a C++ program that reproduces a digital odometer. It has 10 “windows” and will output the miles as you travel, starting at 0000000000 and ending at 9999999999 (after which you probably want to sell the car anyway …).PRODUCE C++ CODDING Write a program that will calculate and print bills for the city power company. The rates vary depending on whether the use us residential, commercial, or industrial. A code of R means residential use, a code of C means commercial use, and a code of I means industrial use. Any other code should be treated as an error. The rates are computed as follows: R: $6.00 plus $0.052 per kwh used. C: $60.00 for the first 1000 kwh and $0.045 for each additional kwh. I: Rate varies depending on time of usage Peak hours: $76.00 for first 1000kwh and %0.065 for each additional kwh. Off-peak hours: $40.00 for first 1000 kwh and $0.028 for each additional kwh. Your program should prompt the user to enter an integer account number, the use code (type char), and the necessary consumption figures in whole numbers of kilowatt-hours. Your program should display the amount due from the user.C ++ - Create a program that calculates the distance an object travels in meters on Earth for a specific number of seconds. Also calculate the distance traveled on the moon, also in meters, for a specific number of seconds. Do not include any global variables Your program must have the main function and, at least, the following four additional functions. The signatures for these functions must be as follows: double readSeconds() double calculateEarthDistance(double seconds) double calculateMoonDistance(double seconds) void displayResults(double seconds, double earthDistance, double moonDistance) The readSeconds function will be an input function that will read in a double value from cin and return that value back to main. The calculateEarthDistance function will calculate the distance an object falls (on Earth) during the specified number of seconds. The calculateMoonDistance function will calculate the distance an object falls (on the Moon) during the specified number of seconds. The…
- Hi, I need the answer to this question using the C++ programming language. Thank you. Question: Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d = 1/2gt2 The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling. Write a function named fallingDistance that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 through 10 as arguments and displays the return value.please give an answer in c ++. Question 3: assign a secret value in your program and ask the user to enter a guess. if the guess is greater than the secret value, print too large; if the guess is less than the secret value, print too less; if the guess is same as the secret value, print you found it. the user has unlimited attempts or terminated by entering a non-number.Which of the following are legal C++ assignment statements? a. a = 7;b. 7 = a;c. 7 = 7;