20. Give meaningful identifiers for the following variables and write a proper C11 declaration and initialization to a reasonable value. (1, 6, 7) 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: 4. Assume X and Y are initialized variables of type double. Write the lines necessary to print…
A: 1) initialize two values x and y with double values. 2)check whether they two agree with seven…
Q: 14- Which one of the following options best describes something that you must use indentation for…
A: Given: 14- Which one of the following options best describes something that you must use…
Q: (b) Evaluate the following expressions and determine the value of all variables, based on the above…
A: Given, int val, h=90, i=8, j=25, j=7; should find values of, i) val = --h % k++ * 2; ii) val = (93+…
Q: Given: int g=10, h=3; Write a single C++ statement that will print the result of floating-point…
A: #include <iostream> using namespace std; int main() { int g=10; int h=3; //single…
Q: Identify global and local variables in the following program. Does a global variable have a default…
A: Identify global and local variables in the following program. Does a global variable have a default…
Q: 6-In K Write the equivalent C++ statement for the following Math formu -2*(x*x' 'y)*(-9*(x*y)+12*(x'…
A: Input of program : for formula 1: b,c,K,L for formula 2: x,y In C++: The * sign is used for…
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: 1/ Which one is not a correct variable type in C++: B.real A.float C.int D.double 2/ Which operation…
A: 1/ Which one is not a correct variable type in C++: A. float B. real C. int D.double 2/…
Q: a. What are the variables of G: b. What are the terminals of G? c. Which is the start variable of G?
A: Note: that only one question can be answered at a time, in compliance with the BNED guidelines. If…
Q: b) Write C++ statements that accomplish the following: . Declares int variables a and b. . Updates…
A: As per our guidelines we are supposed to answer only one question kindly repost other part as a…
Q: Let A={8,9,10}, B={9,10,11,12,15} and C={9,10}. Which of the following statements are true? a) d)…
A: Below is the answer with explanation:
Q: Write program c++ to input a variable can accept any of the following value: A, & , B, 1, *, 3 as…
A: Sample Response: //C++ program to accept a value and prints its data type and…
Q: Show the printout of the following statements:print(format("Programming is fun",…
A: Given: Show the printout of the following statements:print(format("Programming is fun",…
Q: e named constants for numeric literals in the program and do not use global variables. The Speed of…
A: Code: #include<iostream> #include<iomanip> using namespace std; int main() { int…
Q: Write the statements to do the following: assign to variable y the value of two divided by variable…
A: I give the code in JAVA along with output and code screenshots.
Q: 4. The value of integer variable t is equal to 10 and the value of the variable p is 2. Find the…
A: Answer: t=2,p=2
Q: Write C++ expressions that are equivalent to the following mathematical formula. Assuming a, b, c,…
A: a.) (b*b)+(4*(a*c)) b.) a*(b/c) c.) 1/(1+sqrt(1-x))
Q: Suppose the following two are independent statements. Are they correct? Circle c;Circle c =…
A: In C++, to create an anonymous object using a no-argument constructor, it is mandatory to add…
Q: 2. Write C++ declaration statement to accomplish each of the following: Problem C++ Statement…
A: There is the difference between the declaring the variable and initializing the variable When we…
Q: Question 1 Write equivalent compound statements for the following statements. a. x 2*x+x*y* 3; b. x…
A: The question is to write the equivalent compound statements for the given statements.
Q: 2. Write a program to find value of z according to the following equations: Z-xty when r-1 Z-X-y…
A: 2. Purpose: The main purpose is finding the value of z that is by given equations and in…
Q: Q(X, y) Be the statement II the domain for both variables consists 0f all integers, what are the…
A: The suitable answer is " False".
Q: Declare all variables of double type and then translate the following equation to a C++ statement.…
A: The mathematical functions used in the given mathematical equation are sin, log, and the square root…
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: Write a statement or a set of statements to accomplish each of the following tasks:a) Sum the odd…
A: As per our guidelines, we are supposed to answer only 1st three parts. Kindly repost the remaining…
Q: I need help writing a Boolean expression that is true if and only if a student is a senior who is…
A: Let us assume a student is senior if student's year in school is greater than x.
Q: (b) Evaluate the following expressions and determine the value of all variables, based on the above…
A: #SOLUTION: ( i ) expression -> --h % k++ * 2 initially h=90 and k=7 . Now solving the…
Q: (2) Write C expression for the following statements using relational operator. (a) x is not equal to…
A: Relational operators are used to compare values of two expressions. Relational operators are binary…
Q: Question 3: Write a program which reads in a starting day (Mon, Tue, Wed) and a time value in the…
A: from datetime import time,timedelta def main(): print("Enter a time in HHMM format:")…
Q: n the following code. = 40; d func() static int j= 5; } int main() { int k = 0; func(); Which of the…
A: Solution:- In given code, i is global variable because it is declared outside function and is…
Q: Suppose x, y and z are int variables and x = 18, y = 5, and z =4. What is the output of each other…
A: Here, I have to provide a solution to the above question.
Q: Which of the following statements is true? In Python we do not specify variable types, it is…
A: Variables are just memory areas set aside for storing values. This means that when you create a…
Q: Q6: Write C++ program to evaluate the following logical expression and print out the result If the…
A: The answer for the above logical expression will result in False. The reason is : i<=(j*k)…
Q: 8. Write C++ statements to accomplish each of the following: a) In one statement, assign the sum of…
A: we have to perform following operations: a) z = ++x + y b) we can use loop and if statement to…
Q: What is difference between variable declaration and variable initialization? What two things are…
A: Ans - 1: Variable declaration means that giving the name and space in memory of specified type to…
Q: Assume a, b, c and n are float variables, and d, e, fand m are integer variables, what is the result…
A: As I have read the guidelines I can provide answers to only 1 part of the questions in case of…
Q: 8. For each of the following statements, assume that the statement directly follows these lines of…
A: Here is your solution with an output.
Q: Consider the following main function. The blank line represents a line of code that is missing.…
A: We have been given a simple C++ code. We need to create a variable last that can store an employee…
Q: Give meaningful identifiers for the following variables and write a proper C++ declaration and…
A: C++ declaration and initialization for the given variables: a. char grade='A';
Q: Write C++ statement(s) that accomplish the following: Declare int variables x and y. Initialize x to…
A: Given:
Q: Suppose x, y, and z are int variables and x = 18, y = 5, and z = 4. What is the output of each of…
A: Given, cout << "x = " << x << ", y = " << y << ", z = " << z…
Q: Q4 Given the following variable declarations, char characters; int val, h = 90, i = 8, j = 25, k =…
A: #include <iostream>using namespace std;int main(){ char characters; int val , h=90 , i=8 ,…
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…
20. Give meaningful identifiers for the following variables and write a
proper C11 declaration and initialization to a reasonable value. (1, 6, 7)
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 2 steps with 1 images
- 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.- Declare a variable of type character.- Ask the user for a letter and place it in the declared variable.- Write code to check for and output statement stating whether the variable is an upper caseletter, lower case letter, or not a letter (neither of the above).- Write a simple program that is a four function calculator that displays a menu with options a to add, s to subtract, m to multiply, and d to divide two numbers. Ask the user for two float variables in each operation and output the result.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.The declaration statement for a named constant requires . a. a data typeb. a name c. a value d. all of the above
- 38. To pass a scalar variable by reference in C++, you need to include the ____ operator before the formal parameter’s name in the receiving function’s header. a. & c. $ b. * d. @ 42. A simple, or ____ variable, is one that is unrelated to any other variable in memory. a. scalar b. vector c. independent d. dependent 43. You may use an assignment statement or the ____ operator to enter data into an array element. a. comparison b. arithmetic c. extraction d. insertion 44. Each of the ____ (variables) in an array has the same data type. a.elements b.objects c.structures d.subscriptsIn C declare a variable of type character.Ask the user for a letter and place it in the declared variable.Write code to check for and output statement stating whether the variable is an upper caseletter, lower case letter, or not a letter (neither of the above).C++ PROGRAMMING VARIABLE DECLARATION. Create a variable called carName, assign the value Honda to it. Write a C++ assignment statement that assigns the value 23.25 to a float variable named price. Write a C++ assignment statement that assigns the letter T to a char variable named insured. Write the declaration for two variables called feet and inches. Both variables of type int and both are to be initialized to zero in the declaration. Use both initialization alternatives. Write a C++ statement that declares a named constant with identifier name distance and a literal constant value of 14E14.
- QUESTION 1 Evaluate the following expressions, assume the following declarations: int x = 4; int y = 9/2; int num = 6; num *= x + y; What is the value of the num after expression is evaluated?8. The Barking Lot is a dog day care center. Design C++ code for the following: a. A program that accepts data for an ID number of a dog’s owner, and the name, breed, age, and weight of the dog. Display a bill containing all the input data as well as the weekly day care fee, which is $55 for dogs weighing less than 15 pounds, $75 for dogs from 15 to 30 pounds inclusive, $105 for dogs from 31 to 80 pounds inclusive, and $125 for dogs weighing more than 80 pounds.Please do not refuse my homework :) It is very important to me. Homework will be solved with visual studio c# program. Write a program that has the followings:1) A text will be entered by the user.2) After getting the text, the followings will be displayed: First occurence order of each character will be displayed under “Occurence order” title.Character will be displayed under “Character” title.How many times the character is used in the text will be displayed under “Amount of occurence” title. (In short, it will be like the black output screen in the picture)3)At page 2, the flowchart of the solution key of this homework is attached. It is not obligatory but you can use the algorithm used in the flowchart.
- Write a C++ statement that defines the int variables months, days, and years all in the same statement, with months initialized to 2 and years initialized to 3.Needs to be done in C# language. Problem 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 tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded 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. Input Validation: Do not accept negative numbers for any data.Mark the following statements as true or false: a. To use a predefined function in a program, you need to know only the name of the function and how to use it. (1) b. A value-returning function returns only one value. (2, 3) c. Parameters allow you to use different values each time the function is called. (2, 7, 9) d. When a return statement executes in a user-defined function, the function immediately exits. (3, 4) e. A value-returning function returns only integer values. (4) f. A variable name cannot be passed to a value parameter. (3, 6) g. If a C++ function does not use parameters, parentheses around the empty parameter list are still required. (2, 3, 6) h. In C + + , the names of the corresponding formal and actual parameters must be the same. (3, 4, 6) i. A function that changes the value of a reference parameter also changes the value of the actual parameter. (7) j. Whenever the value of a reference parameter changes, the value of the actual parameter changes. (7) k. In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function. (9) l. Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided. (10) m. In a program, global constants are as dangerous as global variables. (10) n. The memory for a static variable remains allocated between function calls. (11)