Ask the user for two numbers (these can be entered in any order). Then print the numbers, and tell the user which one is closer to 50 (whether higher or lower). Some examples:
Q: Write an application that finds the smallest of several integers. Assume that the first value read…
A: Given: Write an application that finds the smallest of several integers. Assume that the first value…
Q: In Python programming language. Write a program that calculates the sum of prime numbers that could…
A: def prime_number(n): #function prime_number if(n == 0 or n == 1): #if n is 0 or…
Q: Write a program that asks the user for the number of adult and the number of child movie tickets…
A: Answer :- #include <iostream> #include <iomanip> using namespace std; int main() {…
Q: What is the value of num when the following code snippet runs successfully? int num = 100; if…
A: According to the question below the solution:
Q: The user must be able to enter the information for a number of bookings from the keyboard. Ask…
A: /******************************************************************************…
Q: Write a program that asks the user for the number of miles driven and the gallons of used. It should…
A: The formula to calculate the miles per gallon of the vehicle is as follows Miles per gallon,…
Q: Which value can be entered to cause the following code segment to display the message: That number…
A: Objective: According to the given question, the correct input from a set of inputs needs to be…
Q: Allow a user to enter any number of double values up to 15. The user should enter 99999 to quit…
A: Program code: import java.util.Scanner;public class DistanceFromAverage { //class members…
Q: Electrical resistors are said to be connected "in series" if the same current passes through each…
A: Hello student Greetings Hope you are doing great. Thank You!!!
Q: A large book box holds 80 lbs, a medium box hold 50 lbs. and a small holds 30 lbs. The average book…
A: A pseudo-code is an informal description of the algorithm, usually in English language. An algorithm…
Q: A county collects property taxes on the assessed value of property, which is 60 percent of its…
A: Step 1: Prompt and accept property value from the user. Step 2: Prompt and accept tax rate per $100…
Q: Write an expression that obtains a random integer between 34 and 55. Write an expression that…
A: To get a random number we will use rand() in c++, also we are going seed time as a parameter to…
Q: 2. If the number is negative then increment Bx by 1, else( If it is positive) increment BX by 2
A: PROGRAM INTRODUCTION: Take the value of both the variables from the user. Use if else condition to…
Q: In [ ]: # write a program to accept a number from the user, # print "Play basketballL" if the number…
A: PROGRAM CODE: n = int(input("Enter the number: ")) // take number from the userif n<=15:…
Q: Write a program that prompts the user to enter a nonnegative integer and outputs the factorial of…
A: #include<iostream> using namespace std; int main(){ int number; cout << "Enter a…
Q: Write a program that asks the user to enter the material they wish to purchase (wood, brick, or…
A: def wood(n): costSingle = 0 shippingCharge = 0 if(n>=1 and n<100): costSingle…
Q: Floor division of two decimal numbers will give answer as decimal number? True or False
A: The division of two decimal number will also give a decimal number. When we devide a number 36.2 by…
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: Floor division of two integer numbers will give answer as integer number? True or false
A: Floor division of two integers always result in giving a final integer, as per the syntax of the…
Q: Write program: prompt user to enter 2 double numbers which are the radius of 2 circles. Save values…
A:
Q: 6- Generates a random number between 1 and 10, Asks the user to guess the number and prints a…
A: Given:
Q: Ask the user for a name and for a list of test scores. Show the number of tests taken and the…
A: Here I have taken input from the user for the name and then created a list to store the marks. Next,…
Q: Write an application that inputs three integers from the user and displays the sum, average,…
A: You didn't mention any programming language, hence according to Bartleby policy, I have answered in…
Q: Write a program that asks the user for a number in the range of 1 through 7. The program should…
A: def main(): # Get the number for the day of the week. day = int(input('Enter a number (1-7)…
Q: Calculator: Initially asks for two numbers. Afterwards, ask the user to select the operator and…
A: def Compute(x,y,op): x=int(x) y=int(y) if op=="+": return x+y if op=="-":…
Q: Ask the user for two numbers (these can be entered in any order). Then print the numbers, and tell…
A: We are using #include<iomanip> so that we can use specific decimal places as we want. We are…
Q: Write a program that asks the user for three numbers and print the numbers in either ascending or…
A: n1 = float(input("Enter number a: "))n2 = float(input("Enter number b: "))n3 = float(input("Enter…
Q: You sell regular coffee at 10 rs/bag, cappuccino coffee at 13 rs/bag, and mocha coffee for 15rs/bag.…
A: Note: Here you didn't mention any programming language so we are creating the program in the C++…
Q: Which of the below Java statements finds the sum of 100, 200, 300, ..., 900, 1000? Select one: a.…
A: The code snippets given are C/C++ /Java code snippets. They can be copied to the IDE and executed to…
Q: In various applications, you are often asked to compute the mean and standard deviation of data. The…
A: Since no programming language is mentioned, I am using java Code: import java.util.*;public class…
Q: randomly choose a number, accept input from the user, and print whether or not the user is correct.…
A: The answer is given below.
Q: program that prompts the user to enter an integer. If the number is a multiple of 5, print HiFive.…
A: As programming language is not mentioned, so we are providing answer in C++ language.
Q: Write Psuedo-code of an algorithm that will repeatedly ask the user to enter a number 10 times. If…
A: Psuedo code is step by step written outline that can be easily translated into the program.
Q: Write a Little Computer Man program that determines if the number entered by a user is an odd or…
A: Process: A number is even if it is perfectly divisible by 2. When the number is divided by 2, we use…
Q: owing statements is false? * A. The value of the following expression is 3: 17 % 5 B. The…
A: Which of the following statements is false? * A. The value of the following expression…
Q: In Python programming language. Write a program that calculates the sum of prime numbers that could…
A: Step 1: Read bStep 2: While (temp=true):Step 3: if b is positive Call sum().…
Q: Write a program that will convert miles to kilometers and kilometers to miles. The user will…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Prompt the user for values of V1 and R1 (between 1 and 100).
A: Given: Prompt the user for values of V1 and R1 (between 1 and 100).
Q: The user must be able to enter the information for a number of bookings from the keyboard. Ask…
A: In the solution of given problem, we need to declare a structure with members: flight number, type…
Q: Which of the following statements assigns a random integer between 25 and 60, inclusive, to rn? int…
A: The solution to the given problem is below.
Q: The user must be able to enter the information for a number of bookings from the keyboard. Ask…
A: Step 1:- Given:- The user must be able to enter the information for a number of bookings from the…
Q: Write an application that gets two numbers from the user and prints the sum, product, difference and…
A: (1)First we need to Design a Java Frame and add all the components and add the listeners to the…
Q: 1. Repeatedly prompt the user to enter positives numbers. 2. Keep track of the largest even number…
A: I have given python code with output below.
Q: The value of x is: Write the value ONLY. DON'T WRITE x=... A- (0 3 0) A - 0 0 .......
A: I have given an answer in step 2.
Q: In various applications, you are often asked to compute the mean and standard deviation of data. The…
A: Mean The mean of the data is sum of the values of all data and then dividing it with total number of…
Q: Write a program to: Prompt the user for each employee’s id (an integer value) and the sales…
A: C++ Program Code: #include<iostream>#include<iomanip>#define MAX 20using namespace std;…
Q: Write a program that takes a number from user and display the output as shown in below two runs of…
A: Given To do pattern program as sample program and input is taken from the user
Q: The code below was designed to count the number of values entered by the user using the keyboard,…
A: Given We know about the programing .
Q: Write an application that will take - 5 digit integer from user and calculate the sum of all digits…
A: Program Explanation:- Using the header file. Using the namespace standard input/output function.…
Please I need to solve this question using the C++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Write an application that will take 5 digits integer from user and calculate the sum of the integer. The application signature is as follows 34567 prints 25?hello im stuck on a problem and it would be great if you could create a program that prompts the user for a message to encode,as well as an offset to encrypt it with. You will then create and use the following methods:• A validation method that takes in the message (as a string) and the offset integerentered by the user. The method should return “true” if the offset is between 0and 26 inclusively and the message contains only letters and spaces. If it failseither criteria, it should return “false”.• If the validation method returns true, a second encryption method should becalled. This method also takes in the message (as a string) and the offset integerentered by the user. It should convert the message to UPPERCASE, encryptevery letter in the message, and leave the spaces as they were. It should thenreturn the encrypted message. i attached an image of the sample outputLET the user print his name and ask him as it is am or pm and print the message accordingly hi name good morning
- An automobile insurance company provides accident insurance if the vebicle’s model year is greater ot equal to 2000 and the number of accidens is less or equal to 6, Write & program that prompts the user to cnter his/her vehicle’s model year and the number of accidents. The program then checks whether or not the client s elgible for an insurance and prints the messages as shown in the sample run. Sample Run 1 | Enter your vehicle’s model yea;x: 010 R A ‘( Enter the number of accidents: 3 I You are eligible for an insurance for your vehicle’s model 2010. Sample Run 2: Enter your vehicle's model year: 2005 Enter the number of accidents: 7 You are not eligible for an insurance for your vehicle's model 2005.Write a program that asks the user to enter a password consisting of 7 characters. If the user enters a password which is not exactly 7 characters, the program should ask the user to enter a password again until the user complies. If the user enters a password which is less than 7 characters, the program should produce a message saying “The password is too short. Only passwords with 7 characters are accepted. Try again.” If the user enters a password which is more than 7 characters, the program should produce a message saying “The password is too long. Only passwords with 7 characters are accepted. Try again.” answer quicklyUsing the Java language, write a program that takes two words as input from the keyboard, representing a password and the same password again. For example,websites ask users to type their password twice when they register to make sure there was no typo the first time around. Use the conditional operator when evaluating the password.
- What is the value of the variable phones after the following code executes?phones = {'John' : '5555555', 'Julie' : '5557777'}phones['John'] = 5556666' {'John' : '5555555', 'Julie' : '5557777'} {'John' : '5556666', 'Julie' : '5557777'} {'John' : '5556666'} This code is invalid.Write an application that will take 5 digits integer from user and calculate the sum of all digits of the integer. The application signature is as follows. Example- for integer 34567 prints 25?Write an application that will take a 5 digits integer from user and calculate the sumof all digits of theinteger.The application signature is as follows: (for example, for integer 34567 prints 25?
- __________ is the command that ignores the carriage return. Group of answer choices system.ignore(80, ‘\n’); system.ignore(80, ‘/n’); cin.ignore(80, ‘\n’); cin.ignore(80, ‘/n’);Write a program that converts U.S. Dollar Amounts to different Cryptocurrencies by multiplying US Dollar amounts times conversion factors stored in named constants. Ask the user to enter the amount of money in U.S. Currency, then display the output of the conversions to the different cryptocurrencies listed below. The following conversion rates must be stored as named constants: 1 US Dollar = 0.00002306 Bitcoin (BTC)1 1 US Dollar = 0.01122814 Ethereum Classic (ETC)1 1 US Dollar = 2.07961078 Dogecoin (DOGE)1 1 US Dollar = 0.48910811 Cardano (ADA)1 Format your currency amounts in fixed point notation with two decimal places of precision, and be sure that the decimal point is always displayed.Write a program that simulates a traffic light. The program lets theuser select one of three lights: red, yellow, or green. When a radio button isselected, the light is turned on, and only one light can be on at a time (seeFigure 9.36a–b). No light is on when the program starts.