What will the following Code segment print on the screen? String Price = "Fifty Dollars"; String Quantity = "20 Pieces"; System.out.printin("Dear Customer you bought " + Quantity +"\n" + "at price of "+Price);
Q: What will the value of the result variable be after the code segment below has been run. int…
A: int number2 = 40;int result = 46; if( number2 <= 84 ){ result *= number2 ;}
Q: Q1:\Write a program to check the temperature of a person and print the status in textbox.…
A: Form Design and Code Result:
Q: There are three seating categories at a stadium . For a softball game, Class A seats cost$15, Class…
A: Code: # include <iostream> #include <iomanip> using namespace std; int main() // main…
Q: What will the value of the result variable be after the code segment below has been run.…
A: Given: What will the value of the result variable be after the code segment below has been run?…
Q: What will the following program segment display? int a = 0, b = 2, x = 4, y = 0; cout…
A: Given: What will the following program segment display? int a = 0, b = 2, x = 4, y = 0; cout…
Q: What will the following Code segment print on the screen?
A: The output of the above java program will be :
Q: The program prints the user's identifier (which could be an email address, a phone number, or a…
A: Below I have provided the java code of the given program. Also, I have attached the output of the…
Q: 3. What is the value of the price variable after the following code snippet is executed? int price…
A: If-else statements determine whether the if expression is true or false. If it is true, then the if…
Q: What will the value of the result variable be after the code segment below has been run.…
A: We have to find the value of result variable using the following information given: bool result ;…
Q: Show what the program segment would display on the screen. int x = 2; int y = 4; cout << x++ << --y…
A: Program- Output-
Q: What will the value of the answer variable be after the code segment below has been run. int…
A: answer is initialized as int number1 =93 number6 =4 answer =93/4 / operator prints the quotient
Q: Tuary. deposit is then made of £1000 at the end of every month for the next 12 months. Interest is…
A: a. Code: amount=zeros(1,12);amount(1)=100000;interest=zeros(1,12);fprintf('Month\tInterest…
Q: the pseudocode for this program? #include #include void main() { char grade[2]; int credithours1,…
A: Objective: A pseudocode should be mentioned for the given C program. It includes all the operations…
Q: Prompt the user to enter a value for dollars, which must not be greater than 150 If the entry is 80…
A: Python Program :
Q: Assume that speed = 10 and miles = 5. What is the value of each of the following expressions? A.…
A: Note : As per guidelines, we can author only 3 sub questions, please repost other sub questions.
Q: What is missing in the following statement? private static final TEXT_TYPE = 'TEXT";
A: Complete the two programming statements given: 1. private static final _____ TEXT_TYPE = "TEXT"; 2.…
Q: What will the following statement display?print('George', 'John', 'Paul', 'Ringo', sep='@')
A: Given: What will the following statement display?print('George', 'John', 'Paul', 'Ringo', sep='@')
Q: What will be written inside the red-box when the below code is executed? Code floatingPointNumber…
A: floatingPointNumber = 0.1print("Started calculation:")if floatingPointNumber * 0.1 == 0.01:…
Q: What will the value of the solution variable be after the code segment below has been run. int…
A: Below is the answer with explanation:
Q: What is the output of the following segment of code if the value 4 is input by the user?int num;int…
A: Solution: The output for the given program is “13” when the user gives “4” as the input.
Q: För System.out.println(“Hello World");
A: The above code is written in java programing language. To run the for loop in a finite way
Q: What will the value of the answer variable be after the code segment below has been run.…
A: initialize answer to bool number3 =5 number5 =30 if number3<= number5 5<=30 true return 1
Q: What is the value of the variable named len after the code that follows is executed?int[][] nums = {…
A: What is the value of the variable named len after the code that follows is executed?int[][] nums = {…
Q: What is the printout if you entered 2 2.5 when executing the following code? double width;…
A:
Q: What will the value of the result variable be after the code segment below has been run. int…
A: Given: What will the value of the result variable be after the code segment below has been run? int…
Q: Assume that an int variable age has been declared and already given a value. Assume further that the…
A: Given:
Q: bool result ; int number3 = 17, number7 = 33;
A: bool result ; int number3 = 17, number7 = 33; result = number3 > number7 ; number3 =…
Q: What will the following program segment display? char dog[] = "Fido";cout << strlen(dog)…
A: ExplanationThe strlen function is a predefined function of string class library.It accepts a…
Q: What will be displayed by the following statement? (Hint: Indent the statement correctly first.) int…
A: Output of the code for if else if loop is detailed in step 2
Q: Please comment all of the following code by using multiple line comment symbol. 1/1 int main() {…
A: Commenting the line of code with multiple line comment in c++
Q: What will the following segment of code output if the value 11 is entered at the keyboard? int…
A: According to the Question Complete Solution in Step 2 and Step 3
Q: Houl 4O Part E Question 1 Part E Question 2 Part E Question 3 Part E Question 4 Part E Question 5…
A: The correct code for the perimeter is:-
Q: QUESTION 8 Kebabo Internet Services offers customers with 600 weekday minutes for a flat rate of…
A: ANSWER:-
Q: Q: By using select case statement write a program to find the value of (z) form the following…
A: Using switchcase stаtement сheсk the number with 0 weаther it is greаter thаn 0 оr…
Q: What is the output of the following segment of code if the value 4 is input by the user? int num;…
A: When the user input the value 4. So, num=4 It will then go into switch case by matching the num…
Q: What will the value of the result variable be after the code segment below has been run. int…
A: The answer to the question depends on which code block of if-else statements is executed. The output…
Q: What will the value of the answer variable be after the code segment below has been run. int…
A: EXPLANATION: Given that the variables answer, number1 and number8 are of integer data type. The…
Q: What will the value of the result variable be after the code segment below has been run.…
A: result is Boolean value either it will 0 or 1 result will be one if either of two statement is true…
Q: What will the value of the solution variable be after the code segment below has been run. int…
A: number4 = 33, number7 = 10 solution = 33 / 10 ( as, number7++ is post increment so, after…
Q: // A standard mortgage is paid monthly over 30 years. // This program is intended to display 360…
A: Answer: for(int i=0; i<30;i++)//this loop is for the year for(int i=0;j<12;j++) printf("the…
Q: Have the user enter number of exam scores you would like to find the average and standard deviation.…
A: According to the information given:- We have to follow the instruction to get the desired output for…
Q: What should be printed on screen? int main() int x = 5; if(x++ == 5) cout<<"Five"<<endl; else if(++x…
A: The output of the given C++ code is: Five Therefore, the correct option is D. Five.
Q: What will be stored in the message variable after the following statement is executed? string…
A: String Concatenation: The "+" operator is used to concatenate two strings. Consider that given two…
Q: QUESTION 10 Choose the correct statement. a. The String method substring returns a char. b. The…
A: Answer: d. The String method substring returns a String.
Q: What will the following segment of code output if the value 11 is entered at the keyboard? int…
A: The given C++ code has to perform the following tasks. It declares the variable “number” in type of…
Q: What will the following program segment display? int funny = 1, serious; if (funny != 1){ funny =…
A: Output:- 5 5
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Step by step
Solved in 2 steps with 1 images
- To evaluate a int data type using switch, the evaluated variable needs to be enclosed in single quotation marks. True FalseInput a value for the variable y so that the variable x becomes 4 after the code executes. favorite_numbers = y favorite_numbers.remove(-1) x = len(favorite_numbers)# Global constant for body mass which is equal to 703 # Create variables and initialize all of them to 0.0 # create variable weight # create variable height # create variable BMI # input the weight from the user. # input the height from the user. # Calculate the body mass: # BMI is equal to weight * body mass divided by (height * height) # Display BMI. # Determine and display weight category if is greater then 25 you are overweight. # if is less then 18.5 is underweight otherwise is good # display all variables
- 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.…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.$majors['CS'] = 'Computer Science'; //Line 1 Smajors['MTH'] = 'Mathematics'; //Line 2 echo "The two majors are $majors['CS'] and $majors['MTH']"; //Line 3 ?> A mistake is found in (Put the line # of the statement as your answer) The corrected statement is
- What will the value of the answer variable be after the code segment below has been run. bool answer ; int number3 = 5, number5 = 30; answer = number3 <= number5 ;For the following code: for ( a = 1, b = 5, c = 3; a < 4; a++, b++ ) { c = a * b + c; } Indicate what values for the following variable will be when the code endsa=b=c=A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98; product 2, $4.50; prod- uct 3, $9.98; product 4, $4.49 and product 5, $6.87. Write an application that reads a series of pairs of numbers as follows: a) product number b) quantity sold Your program should use a switch statement to determine the retail price for each product. It should calculate and display the total retail value of all products sold. Use a sentinel-controlled loop to determine when the pro- gram should stop looping and display the final results.
- Print "userNum1 is negative." if userNum1 is less than 0. End with newline. Assign userNum2 with 4 if userNum2 is greater than 9. Otherwise, print "userNum2 is less than or equal to 9.". End with newline. C codeLab: switch Note: switch syntax is only applied for service selection. You can use if – else syntax for other comparison. Using switch syntax to write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of service: regular and premium. Its rates vary, depending on the type of service. The rates are computed as follows: Regular service: $10.00 plus first 50 minutes are free. Charges for over 50 minutes are $0.20 per minutes. Premium service: $25 plus For calls made from 6:00 a.m to 6:00 p.m., the first 75 minutes are free; charges for more than 75 minutes are $0.10 per minute. For, calls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free; charges for more than 100 minutes are $0.05 per minute. Your program should prompt the user to enter an account number, a service code (type char), and the number of minutes the service was used. A service code for r or R means regular service; a service…T/F 4. The == operator can always be used to test whether two values are identical when evaluating some primitive kind of variable.