write expression that will make the following code print "greater than 20" if the value of user_age is larger than 20... user_age = int(input()) # Program will be tested with values: 19, 20, 21, 22. if ''' Your code goes here ''': print('greater than 20') else: print('20 or less
Q: Write a program that will check the employees years in service and office. • The user will input…
A: For writing the above code, we have used c++ language. Coding in the c++ is easy and efficient. It…
Q: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay…
A: Define the class Employee with data members as pay rate for hour, hours worked, first name and last…
Q: Write a program that reads how much a customer spends on groceries and computes the discount coupon…
A: As no Programming language is mentioned, using Java.
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: Write a program that asks for the names of three runners and the time it took each of them to finish…
A: #include<iostream>using namespace std;int main(){ char r1[20], r2[20], r3[20]; int t1,…
Q: Write a program that lets the user guess whether the flip of a coin results in heads or tails. The…
A: The program has the following algorithm: Declare the necessary variables within the “main()”…
Q: Write a program to display fruit sales receipts. Python language only Apple: Pink Lady -…
A: type1 = input("Which kind of apples would you like: (P)ink Lady 4.99/kilo (F)uji 5.99/kilo: ")qt1 =…
Q: Write a program that prompts the user to enter the ticket price and the number of people. Then, the…
A: The ticketPrice and numberOfPeople are the inputs and totalPrice and discountPercetage will be the…
Q: Q2: using java please type this code Code Problem 2 Book Sales Barnes and Nobles sells a package…
A:
Q: Create a program that will distinguish the age of the student. If the student is 13 to 19 years old,…
A: Step-1: Start Step-2: Declare a variable age and take input from user Step-3: If age is greater than…
Q: Write a program that allows the user to input his/her name, gender, height (m) and weight (kg). Then…
A: C Program #include<stdio.h>int main(){ char name[50],s[20]; float weight,height,bmi;…
Q: Write a program that will display "IT'S COLD!" if the temperature is less than 20, "IT'S HOI" if the…
A: #include <iostream> using namespace std; int main(){ float t; cout<<"Computing the…
Q: Write a program that asks the user for an angle, entered in degrees. The program should then display…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Write a simple payroll program that will display employee's information. The program should perform…
A: Given The answer is given below
Q: Design a program that asks the user for a series of names (in no particular order). After the final…
A: Sentinel controlled while loop : The sentinel is a flag value that can be numerical or boolean or…
Q: Write a program that asks the user for their name and their height in inches ("Enter your name: ",…
A:
Q: Write a program to calculate the estimated engine horsepower of a car based on the weight of the car…
A: As no programming language is mentioned, it is solved using basic C++
Q: remember, some companies use letters to show their telephone number. For example, the telephine…
A: //Use "stdafx.h" only, if using visual studio. #include "stdafx.h" // Declare necessary header…
Q: Write a program that will allow a grocery store to keep track of the total number of bottles…
A: The solution of the given problem is given below:
Q: Need help with the code for this question: Write a program that prompts the user to input an…
A: Programming language is missing in the question. So we will answer this program in C++ languages. If…
Q: The date June 10, 1960, is special because when we write it in the following format, the month times…
A: As the language is not mentioned, So I have done this program in python.
Q: Test the following program for different values and identify the error. int main() { double…
A: I have given an answer in step 2.
Q: Write an expression that will cause the following code to print "less than 20" if the value of…
A: Please find the answer below :
Q: A variable in a program is a named placeholder that can contain any integer value. The statement z +…
A: Below is the complete solution with explanation of the given question. The value of each iteration…
Q: When you make taffy (a pliable candy), you must heat the candy mixture to 270 degrees Fahrenheit.…
A: Given:
Q: Write a program thatreads in investment amount, annual interest rate, and number of years and…
A: Program Plan: Import java util.scanner which contains utility classes for scanner object create the…
Q: Q Evaluate the following Java expression, if x-3, y=5, and z=10: ++z+y-y+ Z+X++
A: Prerequisite: ++x is a pre-increment operator. It first increments the variable value and then the…
Q: Write an expression that will cause the following code to print "I am an adult" if the value of…
A: #aksing user to enter ageuser_age=int(input()) #checking if age is less than equal to…
Q: Question 1 Write a program that asks the user to enter the number of passengers in an airplane and…
A: "Since you have not mention any programming language, so will write our program in C language." C…
Q: Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the user…
A: Start Input weight in pounds Input height in inches Convert weight to kilograms Convert height to…
Q: Write a program that will allow a grocery store to keep track of the total number of bottles…
A: Pseudocode:- Pseudocode is a made-up, informal programming language that helps programmers create…
Q: The following table shows the approximate speed of sound in air, water, and steel:Write a program…
A: Given: You can calculate the amount of time ittakes sound to travel in air with the following…
Q: Complete the following program skeleton so it displays the volume of a cylindrical fuel tank. The…
A: Complete Source code for the program #include <iostream>#include<cmath> using namespace…
Q: Write a program that asks the user to enter the three sides (a, b and c) of a triangle as double…
A: Since no programming language was mentioned in the question, I have used C language to solve.
Q: A car insurance company charges a base fee of BD 50 per year, plus the following fees for any…
A:
Q: Write a program that computes the body mass index (BMI) of an individual. Your program should begin…
A: Note : Here I have asked for the height in inches and weight in pounds from user. Algorithm : Step…
Q: (b) A triangle can be classified based on the lengths of its sides as equilateral. isosceles or…
A: Algorithm for the code: Step 1: Declare three sides of the triangle. Step 2: Enter three sides at…
Q: Write a program that asks the user for an angle, entered in degrees. The program should then display…
A: Input angle Convert to radians Call respective methods and print result
Q: Retype the below code. Fix the indentation as necessary to make the program work. if 'New York' in…
A: In Python, Indentation is used to highlight the blocks of code. Whitespace is used for indentation…
Q: The date June 10, 1960, is special because when we write it in the following format, the month times…
A: since you have not mentioned the programming language, I will attempt in python. please repost again…
Q: You will write a program that uses a for statement to calculate and display the product of all odd…
A: Java used to answer this question
Q: We want to create a program that accepts exactly 100 recycled can donations. Each donation consists…
A: accumulator pattern is where the result is stored in variable and it gets updated in each iteration…
Q: Write a program that converts temperature from Fahrenheit to Celsius and vice versa.
A: Dear Student below is the Java code provided for Fahrenheit to Celsius and vice versa conversion.
Q: The New Telephone Company has the following rate structure for long-distance calls: The regular…
A: Solution:
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: A county collects property taxes on the assessed value of property, which is 60 percent of its…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: The date June 10, 1960, is special because when we write it in the following format, the month times…
A: Java : Java is a class-based, object-situated programming language that is intended to have as…
Q: Write a Python program that asks user to enter the month (1-12) and the year. The program should…
A: Program Approach - Prompt user to enter the month and year. Define the leap() function to determine…
Q: Print two f-string statements to display the following according to the rules below: 1) Food…
A: #declare all the given fieldsfood1 = 'Salad'food2 = 'Sandwich'price1=3.6price2=4.99 #print the food…
write expression that will make the following code print "greater than 20" if the value of user_age is larger than 20...
user_age = int(input()) # Program will be tested with values: 19, 20, 21, 22.
if ''' Your code goes here ''':
print('greater than 20')
else:
print('20 or less')
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- The ideal gas law allows the calculation of volume of a gas given the pressure(P), amount of the gas (n), and the temperature (T). The equation is:V = nRT / PSince we only have used integer arithmetic, all numbers will be integer values with no decimal points. The constant R is 8.314 and will be specified as (8314/1000). This gives the same result. Implement the idea gas law program where the user is prompted for and enters values for n, T, and P, and V is calculated and printed out. Be careful to implement an accurate version of this program. Your program should include a proper and useful prompt for input, and print the results in a meaningful manner.The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows: If the number of rooms booked at least 10, the discount is 10%; at least 20, the discount is 20%; and at least 30, the discount is 30%. Also if rooms are booked for at least three days, then there is an additional 5% discount. Write a program that prompts the user to enter the cost of renting one room, the number of rooms booked, the number of days the rooms are booked, and the sales tax (as a percent). The program outputs the cost of renting one room, the discount on each room as a percent, the number of rooms booked, the number of days the rooms are booked, the total cost of the rooms, the sales tax, and the total billing amount. Your program must use appropriate named constants to store special values such as various discounts.The short-term, 0-24 hours, parking fee, F, at an international airport is given by the following formula: Where int(h + 1) is the integer value of h + 1. For example, int(3.2) = 3, int(4.8) = 4. Write a program that prompts the user to enter the number of hours a car is parked at the airport and outputs the parking fee.
- Write an expression that will cause the following code to print "I am an adult" if the value of user_age is greater than 19. This is what I have so far.... user_age = int(input()) #Program will be tested with values: 18,19,20,21. if _____________________ : print('I am a teenager') else: print('I am an adult') PYTHONstoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”stoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”Notice that the expression on the right side of the formula above will force thecompiler to convert everything to type double. Use type double for your workingvariables. Write your program so that it is able to produce the following screendisplay:Sample session:Enter your speed (in mph): 60.0Enter your tailgate distance (in feet): 240.0Major wreck!
- To make telephine numbers easier to remember, some companies use letters to show their telephone number. For example, the telephine number 438-5626 can be shown as GET-LOAN. In some cases, to make a telephone number meaningful, compaines might use more than seven letters. For example, 225-5466, can be displayed as CALL-HOME, whic uses eight letters. Write a program that prompts the user to enter a telephone number expressesd in letters and outputs the corresponding telephone number in digits. If the user enters more than seven letter, then process only the first seven letters. Also, output the -(hyphen) after the third digit. Allow the user to use uppercase and lowercase letters, as well as spaces between words. Moreover, your program should proces as many telephone as the user wants. (Hint: You can read the entered telephine number as a string and then use the charAt() to extract each character.)Use Language: C Write a program that accepts a number and determines whether the number is positive or negative. If it is positive, display the message “Positive!”. Otherwise, display “Negative!”. #include<stdio.h>int main(void){ int num; scanf("%d", &num); if(num>=0) printf("Positive!"); else printf(“Negative!”);} -THIS is the given program but its wrong Example Input Result 5 Positive! -3 Negative!Write a program that will check the employees years in service and office. • The user will input number for years and in service and the following offices(IT, ACCT, HR)
- Write a program that prompts the user to enter an integer between1 and 12 and then displays the name of the month that corresponds to the integerentered by the user. For example, if the user enters three, the program shoulddisplay March.In Ruritania, fractional numbers are rounded up to the next integer if the fractional part is at least 0.25. However, if they are negative, they are rounded down to the next lower integer if the fractional part is more than 0.75. For example, 2.5 → 3 2.25 → 3 2.24 → 2 -2.3 → -2 -2.76 → -3 -3.25 → -3 Complete the following program to print out the integer, using Ruritanian rounding. please help, I'm only passing 4/6 tests for some reason!Write an expression that will cause the following code to print "less than 20" if the value of user_age is less than 20. user_age = int(input()) #Program will be tested with values: 18,19,20, if ' ' ' Your code goes here ' ' ' : else: print('20 or more') PYTHON please