Which one of the following (2 statements use to print the ? value of the variable num1 cout<<"num1"<
Q: :Q4: Multiple choice (2) jlahäi Which one of the following (1 ? identifiers is invalid floaT bool…
A: 1. Which one of the following identifiers is invalid? floaT bool Int _o_ ANS: - option(b) bool is…
Q: When the following main function runs, what will display on the screen? int main() {int number;…
A: Output: The value is number
Q: Write a C++ statement that prints the message “The number is not valid.” if the variable hours is…
A: Step 1:- Program Approach:- 1.Include the header file 2.Declare the variable of data type integer…
Q: namespace std; int main() { int x, num2; cout>x; num2=x++; cout<<"\nx :…
A: Start Intialise variables Increment x and assign it to num2 Print num2
Q: Question 3: Code conversions (a) operator to if-else statement. Re-write the following program by…
A: #include<iostream.h> usind namespace std; int main() { int Num1,Num2,Num3; cout<<"Enter…
Q: Which code segment results in "true" being returned if a number is even? Replace "MISSING CONDITION"…
A: Option A - A variable num modulo 2 is used to check the num variable is even or not. The modulo…
Q: just need to tell what the code is doing as no 1 is done Briefly comment each of the following…
A: The ask is to explain the given snippet of code.
Q: Question 15 Which of the following switch statements Is equivalent to this if statement: int x = 10;…
A: In option C, default:"not less"; is changed to default:cout<<"not less"; then we will get…
Q: Can Boolean methods be used to make input validation more modular? Why does this happen or why…
A: Given: Input validation may be modularized with the use of Boolean procedures, the answer being…
Q: What is the output of the following code segment if the user enters 90 for the score? cout >…
A: Given code snippet(ignoring syntax error and assuming the code is executable) 1. cout<< "Enter…
Q: this is valid c++ code inside the main(): int a = 10; int b = 20; %3D
A: In the provided code ,it is
Q: Will the if/else statement shown on the right below function exactly the same as the two separate if…
A: Yes, if/else statement shown on the right below function exactly the same as the two separate if…
Q: Please note global variables are not allowed to use in this assignment except of global constants.…
A: Code: #include <iostream> using namespace std; // get sales from user int getSales(string…
Q: cout « "Numbers are:\n"; for (int i=0;i<10;i++){ cout « a[i] « "\n"; }
A: EXPLANATION The first array is defined. The size of the array is 10. In the first loop, the user is…
Q: Input age from user and check if user eligible to vote or not. eligible if age>=18. Not eligible if…
A: Take input age from user and use 'if'-'else' to check if age is greater than 18 or not. Print…
Q: Which of the following are not valid cout statements? A) cout << "Hello world";B) cout…
A:
Q: Write the following code: 1. Declare a variable named hasNext. 2. Assign hasNext the value true. 3.…
A: Introduction:- bool data type supports storing values true and false. To store data values of…
Q: 5. Rewrite the following code using a switch statement.
A: Approach Here, we are asked to replace if else-if with a switch statement. We will use the switch…
Q: An inexperienced C++ programmer has written the nested conditional statement shown below. The…
A: Here is your solution -
Q: One of the following statements is legal to call the following function named Fu void Fun ( bool x…
A: Bool data type in c++ can accept any integer value. Any integer value except 0 is considered as…
Q: Q. Determine what each statement causes to happen in the following program: #include using…
A: Q. Determine what each statement causes to happen in the following program: #include…
Q: Write a program segment that prompt for user input. The program will display the message, "C++…
A: 1. value ← reading user input 2. if value = 'c' then 3. display "C++ Programming" 4.…
Q: namespace std; // function to print the menu void printMenu() { cout<<"Program 1: Gladiolus"<<endl;…
A: I have included a function named printSpace() which will only print blank spaces instead of :.
Q: Which of the following choices represents what may print from line 2 after the following C++ code…
A: option c will be printed. 130 003FR8A0 130
Q: Which of the following statements outputs the value of variable score? a) score >> cin; b) cin >>…
A: The cin object in C++ is an object of class istream. It is used to accept the input from the…
Q: C++ Do not use str:: First, read in an input value for variable numVals. Then, read numVals…
A: Algorithm of the code: 1. Declare an integer variable numVals 2. Prompt the user for an input…
Q: #include xoid main(void) int J: soutee"t in the if statement"ce"ia sd and jeid \n", L): cout *…
A: Given i=0 j=1 If condition i==0(true) so i=5
Q: Ohe of the following statement Is wrong a- int 1no; O b-a+=b; O c-cout<<"hello"; O d- /* comment: *…
A: The answer is..
Q: Q4. Write a missing C code that does the below requirements: 1. The program displays "Enter your…
A: Coded using C language.
Q: Which of the following is illegal? O int *ptr1; char ch = 'A', *ptr &ch; O float ptr; O int i; float…
A: The answer is
Q: DETERMINE THE RESULT OF THE FOLLOWING CODE IF THE INPUT IS 20 #include using namespace std; int…
A: In first case if input is 20 then in number it will be 20 then if 20 %2 =0 then in remainder it…
Q: Which one of the follo O */ Comments */ ** Comment **
A: Which one of the following is the correct form of a comment statement in C++?
Q: Q/if| Integer variable, when the following code is executed, the print output
A: I is an integer value. for(I=1;I++<=4;) Loop runs for I value 1 to 4 Here I is post increment so…
Q: What is the output of the following cout statement? cout >> 29 / 4 << endl;
A: I have given an answer in step 2.
Q: Which of the following are not valid cout statements? (Circle all that apply.)A) cout <<…
A: Lets see the solution.
Q: 1. Write the following statement in C++ C = h + 12 b²+ k³
A: - We need to write the statement in C++.
Q: Which of the following statements places input into the variable "value"? a) value >> cin; b) cin >>…
A: The cin object in C++ is an object of class istream. It is used to accept the input from the…
Q: Write a C++ statement that prints the message “The number is valid.” if the variable temperature is…
A: C++ statement that prints the message “The number is valid.” if the variable temperature is within…
Step by step
Solved in 2 steps
- Program Purpose - Professional Athletes often hire other professionals to help take care of matters for them. We will group them in four categories: Lawyers, Personal Assistants, Agents, and Trainers. They all get paid a percentage of the athlete's total yearly salary. Lawyers - 10%, Personal Assistants - 3%, Agents - 7%, and Trainers - 5% . Prompt the user to enter the athlete's salary for the year (ensure that the entered value is positive). The user should then enter the name and category of each of the hired professionals. The athlete should be able to hire as many professionals in each category as he/she wants, even if it is more than he/she can afford. Based on the category, calculate the amount that each professional should be paid. After all data has been entered, print the names of each professional hired, how much each is being paid, the total amount the athlete paid, and how much the athlete has left.age from user‘ and check if user elj:. ie it age>-18L Not ellglble mf adgQ3/ Correct the simple C++ code: #include using namespace sud; int main( { double firstNum, secondNum, prodNumb; cout >> "Enter two numbers: "; cin >> firstNum << secondNum prodNumbers = firstNum * secondNum; cout << "Product = " << prodNumb; return 0; }
- ?Which line in the following code is called the prompt line #include //linel using namespace std; //line2 int main() //line3 { { //line4 int n; //line5 long f = 1; //line6 cout > n; //line8 cout<< "the integer you entered is: "<Recommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill EducationDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education