Choose all the correct options from the choices given below: What does this program do? a=3 b=10 c=pow(b,2) d=pow(2,a) O a. Calculates square of 2 and cube of 10 O b. Calculates square of 10 and cube of 2 O c. Calculates square of a and cube of b O d. None of the above
Q: Choose all the correct options from the choices given below: What does this program do? a=3 b=10…
A: The preprocessor #include<cmath> has various functions that compute and transform the…
Q: 01: Draw a flowchart for work the traffic lights ? Q2: Write the algorithm required to find the…
A: Q1 flowchart is as given below :
Q: QI/ choose one of the questions- • a-Evaluate each of the following expressions, assuming in each…
A: A) a. m-8-n => 40-8-12 => 20 b. m=n=9 Here m and n will be assigned value 9 c. m%n =>…
Q: I having trouble coding this program on Java: A variable like user_num can store a value like an…
A: Program approach - Importing the java packages. Declare the class. Define the main method. Declare…
Q: The problem is not the lower and upper case the problem is the quotation marks. The sentence,…
A: - The question is to read the string with the quotes and print accordingly with the quotes. - We…
Q: The following words have three consecutive letters that are also consecutive letters in the…
A: Program to find the three consecutive letters which also in consecutive alphabetical order from a…
Q: Modify the above program to compute the side area, total area, and volume of a cylinder and the area…
A: PROGRAM STRUCTURE: Include the required header files. Write the definition of the first function.…
Q: The following table shows the rate of commission that will be paid to the salesman according to the…
A: PROGRAM STRUCTURE: Include the required header files. Start the definition of the main function.…
Q: A variable like user_num can store a value like an integer. Extend the given program as indicated.…
A: Answer Code in python language user_num1=int(input("Enter integer:\n"))print("You…
Q: Q3: CHOSE TWO ONLY. A: Write two differences between input box and message box? B: What are the…
A: 1) InputBox(): InputBox() function is used to take the input from the user at run time. MsgBox(): It…
Q: Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham…
A: Code Screenshot :
Q: Suppose x and y are integer variables, consider the following if ( x> 9) y = 5; else if ( x <9) if…
A: Answer is option e y = 8 ========== Explanation ========= int x = 9, y; if(x > 9)…
Q: Q1: Draw a flowchart for work the traffic lights ? Q2: Write the algorithm required to find the…
A: NOTE: We’ll answer the first question since the exact one wasn’t specified. Please submit a new…
Q: The program below simulates tossing a fair coin N times. The program computes the longest sequence…
A: Let's see step by step: 1. const int HEADS = 0; const int TAILS = 1; here HEADS is initialized…
Q: Given four positive integers a, b, c, and d, compute the sum of those among them that are odd.…
A: PROGRAM: //Defining class OddSum public class OddSum { //Defining main() function public static…
Q: A discount of 20% will be given to any goods that is bought from GMART shop. Write a program that…
A: Here is the solution which is mentioned below : NOTE: Programming lamguage is not given, I have…
Q: Modify the above program to compute the side area, total area, and volume of a cylinder and the area…
A: The program is written in java
Q: Create a new version of the program below that uses Boolean expressions for making the required…
A: def valid_triangle(a,b,c): if a+b>=c and b+c>=a and c+a>=b: return True else:…
Q: (C PROGRAMMING ONLY) 7. Cornered! by CodeChum Admin Attention again soldier! Our men have been…
A: Find the required code in C given as below and output :
Q: Jerry Feingold wants a program that will help him calculate the amount to tip a waiter at a…
A: Create a class Tip. Declare variables to hold the values of total bill, liquor charge, tip…
Q: Professor Chang wants a program that calculates and displays the area of a circle, given the…
A: Start Input Radius Calculate Area=3.14*radius*radius Print Area Stop
Q: Choose all the correct options from the choices given below: What does this program do? a=3 b=10…
A: Code: a=3b=10c=pow(b,2)#this is equal to b^2 = 10^2=100 which is square of 10d=pow(2,a)#this is…
Q: mm yes program.py > fype your answer to "Summarise hair and eyes" here.
A: Lets see the solution in the next steps
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: C++ Code for the given Question #include<bits/stdc++.h>#include <iostream> using…
Q: 9. Write a program that inputs two real numbers then exchanges their values. 10. Make a program that…
A: To write a program for the following to input two real numbers then exchange their values. to…
Q: Choose all the correct options from the choices given below: What does this program do? a=3 b=10…
A: a =3 b = 10 c = pow(b,2) #102 d = pow(2,a) #23
Q: Which of the following solves the given problem? Problem: Create a program that will determine if…
A: Required: Problem: Create a program that will determine if an input character is a number, a letter,…
Q: Read your name and one numeric value [Omani Rial], print the following menu as shown in below…
A: Please find the answer below
Q: 1. If a=1, b=2, and c=3, what are the values of a, b and c at the end of the following program…
A: As per our guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: Consider the following program: int x, y; cin >> x>> y; if(x>y) x = x-y; else if(x<y) y= y-x; else…
A: Please find the answer below :
Q: (c program only) 2. Jack `N Poy by CodeChum Admin Jack `N Poy is a very common game since our…
A: Code: #include <math.h>#include <stdio.h>#include <stdlib.h>#include…
Q: In a 50-person class, students with grades below 70 are considered unsuccessful. Write an algorithm…
A: Algorithm: Step 1: Start Step 2: Declare grade variable Step 3: Input grade Step 4: if…
Q: What will be the output for the program given below? A=20 B=5 C=A/B print(A,"/" ,B,"=",C) %3D
A: The code for the above question is as follows:-
Q: 1-What will be the output of this program: a = [pi: pi/2: 4*pi]; m = 3* cos(a); Your answer
A:
Q: C program based on the algorithm below Welcome to the temperature conversion program. Please…
A: PROGRAM: //Header files #include <string.h> #include <stdio.h> //Defining the main int…
Q: salesman has n things to sale .The cost price of all n things is different out of which p things he…
A: The c program is written for calculating the net profit / loss based on the input from the user.…
Q: Goal: This task is to compute the ticket price for a person based on the type of fare (one way or…
A: """Program to compute the ticket prioce for person based on the type of fareand age group""" #define…
Q: When Jacob Steinberg began his trip from California to Vermont, he filled his car’s tank with gas…
A: This program is used to calculate and find the car's gas mileage at any time. We know the formula to…
Q: ver An old Arabian d has ir that a leger bulous but unthinking King beggan agieed to give a תאתו…
A: Here is the C++ program for the above scenario.
Q: You are given the code below. It's a game where the user has to guess a sequence of four 1-digit…
A: Since there are multiple sub parts in this post, as per our policy I'll answer the first three…
Q: Justin receives 52 weekly paychecks per year. Each week, he contributes a specific percentage of his…
A: Program code: //define a class AnnualCal public class AnnualCal { //define main function public…
Q: Suppose that you work for a beverage comnpany. The company wants to know the optimal cost for a…
A: The program is written in C language.
Q: Take user input for a sentence (character by character) and count total number of vowels both…
A: Input character by character into a string till user moves to new line Compare each character and…
Q: The following formula gives the area of a triangle and volume of a triangular prism. Area = s(s –…
A: The cost of the carpet per square meter is = area * 1010.85
Q: What does the following code display? boolean p = if(!p) System.out.print("A"); else true, q =…
A: The answer is: B. B code: public class MyClass { public static void main(String args[]) {…
Q: A. Prompts the user to enter the total amount of milk (in liters) produced in the morning. B.…
A: Code implementation: import java.util.Scanner;public class Main { public static void main(String…
Q: Suppose that you work for a beverage company. The company wants to know the optimal cost for a…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: the electrical resistance r (in ohms) of a metal wire is given by the formula r = (ml)/ a where m is…
A: As no programming language is mentioned it is solved using basic C++
Q: Suppose that you work for a beverage company. The company wants to know the optimal cost for a…
A: I have given an answer in step 2.
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:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Exercise 3.9Modify program P34_1.cpp to compute the side area, total area, and volume of a cylinder and thearea and volume of a sphere, depending on the choice that the user makes. Your program shouldask users to enter 1 to choose cylinder or 2 for sphere, and display an "invalid choice error" forother values.For a cylinder, we want to compute:Side area: (2*PI*r) * hTotal Area: 2*(PI*r2) + Side areaVolume: (PI*r2)*hFor a sphere, we want to compute:Surface area: 4*PI*r2Volume: (4.0/3.0)*PI*r3.Use overloading whenever possible.Call your new program Ex39.cpp.(c program only) 2. Jack `N Poyby CodeChum Admin Jack `N Poy is a very common game since our childhood days. Just thinking about it makes me reminisce how I crushed my cousin in this game until he cried ? I want to feel the glory again of being very good at something. Could you help me recreate the game? It's really simple. In Jack `N Poy, there are two players who both select either one of the following options: RockPaperScissors The winner is selected depending on the following rules: Rock beats ScissorsScissors beats PaperPaper beats RockIf both players chose the same option, then it's a tie Instructions: In the code editor, you are provided with an enum called option which contains three possible named values:ROCK - 'r'PAPER - 'p'SCISSORS - 's'Your task is to ask two users for there chosen options. And then based on their options, determine the winner.Input 1. Option selected by Player 1 2. Option selected by Player 2 Output If Player 1 wins, print the message "Player 1…Explain the flow of this program ? def new_game(): guesses = [] correct_guesses = 0 question_num = 1 for key in questions: print("-------------------------") print(key) for i in options[question_num-1]: print(i) guess = input("Enter (A, B, C, or D): ") guess = guess.upper() guesses.append(guess) correct_guesses += check_answer(questions.get(key), guess) question_num += 1 display_score(correct_guesses, guesses) # -------------------------def check_answer(answer, guess): if answer == guess: print("CORRECT!") return 1 else: print("WRONG!") return 0 # -------------------------def display_score(correct_guesses, guesses): print("-------------------------") print("RESULTS") print("-------------------------") print("Answers: ", end="") for i in questions: print(questions.get(i), end=" ") print() print("Guesses: ", end="") for i in guesses:…
- When Jacob Steinberg began his trip from California to Vermont, he filled his car’s tank with gas and reset its trip meter to 0. After traveling 324 miles, Jacob stopped at a gas station to refuel; the gas tank required 17 gallons. Jacob wants a program that calculates and displays his car’s gas mileage at any time during the trip. The gas mileage is the number of miles his car can be driven per gallon of gas. Desk-check your solution’s algorithm using 324 as the number of miles driven and 17 as the number of gallons used; then desk-check it using 280 and 15.The manager of Mama Calari’s Pizza Palace wants a program that calculates and displays the number of pizza slices into which a circular pizza can be divided. The manager will enter the radius of the entire pizza. For this exercise, use 14.13 as the area of a pizza slice, and use 3.14 as the value of pi. Desk-check your solution’s algorithm using 10 as the pizza’s radius; then desk-check it using 8. (Hint: For the first desk-check, the number of pizza slices should be a little over 22.)Justin receives 52 weekly paychecks per year. Each week, he contributes a specific percentage of his gross weekly pay to his retirement plan at work. His employer also contributes to his retirement plan, but at a different rate. Justin wants a program that calculates and displays the total annual contribution made to his retirement plan by him and his employer. Desk-check your solution’s algorithm using $640 as the gross weekly pay, 6% as Justin’s contribution rate, and 4% as the employer’s contribution rate. Then desk-check it using your own set of data.
- Create a new version of the program below that uses Boolean expressions for making the required decisions. Simplify the selection statements as much as possible. # Entering the sides of triangle a = int(input("Enter the length of first side :"))b = int(input("Enter the length of second side :"))c = int(input("Enter the length of third side :")) # CHECKING WHETHER TRIANGLE IS VALID OR NOT if(a + b >= c): if(a + c >= b): if(b + c >= a): print("Triangle is Valid") print("Perimeter is:",a+b+c) else: print("Triangle is Invalid")Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylindrical containers. The shipping charges depend on the amount of the liquid in the container. (For simplicity, you may assume that the container is filled to the top.) They also provide the option to paint the outside of the container for a reasonable amount. Write a program that does the following: Prompts the user to input the dimensions (in feet) of the container (radius of the base and the height). Prompts the user to input the shipping cost per liter. Prompts the user to input the paint cost per square foot. (Assume that the entire container including the top and bottom needs to be painted.) Separately outputs the shipping cost and the cost of painting. Your program must use the class cylinderType (designed in Programming Exercise 3) to store the radius of the base and the height of the container. (Note that 1 cubic feet = 28.32 liters or 1 liter = 0.353146667 cubic…Can you please find the correct answer or answers for the question below? Program is in Python. def area(side1, side2): return side1 * side2s1 = 12s2 = 6Identify the statements that correctly call the area function. Select ALL that apply. Question 5 options: result = area(side1,side2) print(f'The area is {area(s1,s2)}') answer = area(s1,s2) area(s1,s2)
- (C++) Jason opened a coffee shop at the beach and sells coffee in three sizes:small (9 oz),medium (12 oz),and large (15 oz). The cost of one small cup is $1.75, one medium cup is $1.90, and one large cup is $2.00. Write a menu-driven program that will make the coffee shop operational. Your program should allow the user to do the following: Buy coffee in any size and in any number of cups. At any time show the total number of cups of each size sold. At any time show the total amount of coffee sold. At any time show the total money made. Your program should consist of at least the following functions: a function to show the user how to use the program; a function to sell coffee; a function to show the number of cups of each size sold; a function to show the total amount of coffee sold; and a function to show the total money made. Your program should not use any global variables and special values such as coffee cup sizes and cost of a coffee cup must be declared as named constants.…Create a program that asks the user for a non-negative amount of money (in Pesos). Once the user has given the amount, the program should print a menu of actions to be done on the input. The possible actions are the following: 1) Convert to US Dollars (51.07 Pesos = 1 Dollar) 2) Convert to Japanese Yen (1 Peso = 2.24 Yen) 3) Convert to Euro (1 Peso = 0.017 Euro) 4) Compute for Savings - The user will be asked how many % of the initial input will be saved and to what currency will the savings be converted (Must use functions created for 1-3 to convert). Your program should have at least six functions 1) A function for the menu 2) A function for asking the initial input 3) Convert to US Dollars 4) Convert to Japanese Yen 5) Convert to Euro 6) Compute for Savings (Can ask for additional input. Will have to use functions 3-5 for conversion) DO NOT USE GLOBAL VARIABLES for your functions. Make sure to pass your inputs as parameters. Then return the result.…Can you please answer the following question! The program is in JavaScript and must contain readline-sync. Thank you! There is a theorem called "Fermat’s Last Theorem". This theorem states that there are no integers a, b, and c such that a^n + b^n = c^n, except when n ≤ 2. (^ means raised to the power) Write a program named fermat.js that asks the user for four numbers – a, b, c and n. The program should then check to see if Fermat’s theorem holds. If n is greater than or equal to 2 and a^n + b^n = c^n (^ means raised to the power), your program should display “Fermat's theorem does not hold!” Otherwise the program should display “Fermat's Theorem holds” Hint: You may want to use Math.pow. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow What is a Theorem? https://virtualnerd.com/algebra-2/fundamentals/theorem-corollaries/theorem-definition