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') PYTHON
Q: 2. Write a simple payroll program that will display employee's information. The program should…
A: pay roll program that will display employee's information
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 function that converts milliseconds to hours, minutes, and seconds using the following…
A: Steps to convert milliseconds to seconds, minutes, and hours as follows Total seconds = Milli…
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: 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: Create a program that will ask the user to input a number and then determine if the number is an odd…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Write a program which should display 4 items (keyboard, mouse, monitor and speaker) with their…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A:
Q: Points on a two-dimensional plane are specified uniquely using two numbers, the point’s distance…
A: The program declares the 2 points of double type and reads the values from the user. Call the…
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: In Python, how do I change my code to display the correct way. The salaries should be floating…
A: employee_names=[]employees_salaries=[] while True: employee_name=input("Enter employee name: ")…
Q: Suppose you want to deposit a certain amount of money into a savings account with a fixed annual…
A: The first three steps are to get the inputs from the user which are the annual interest rate Number…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: PROGRAM: //Importing the required header file import java.util.Scanner; //Defining the class…
Q: Suppose the Great Frederick Fair wants to update its ticketing software. They need you to write a…
A: A required Python program is as follows, #Set the constant BASIC_PRICE=40 BASIC_PRICE_Fredrick=35…
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: a) Write a program that begins by reading a radius, r from the user. The program will continue by…
A: TO FIND AREA AND VOLUME OF THE CIRCLE
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: Create a program that will ask the user to input a number and then determine if the number is an odd…
A: Below is the program:
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: The program down below has a code for a program to play a guessing game with the user. The program…
A: Here as per your requirement of code i mentioned java code. for Random Guess create guessing game.
Q: 1. Create a program that asks for a distance in kilometers and converts it into its metric…
A: /*C program to ask distance in kilometers and converts it into its meter equivalent*/ #include…
Q: Create a program that determines how quickly an object is travelling when it hits the ground (we'll…
A: Program: import math#print final velocity calculatorprint("Final velocity calculator")#print to ask…
Q: Write a program that computes the cost of painting and installing carpet in a room. Assume that the…
A: In this question, we will create a class ROOM to store the properties of the room and to calculate…
Q: A savings account is opened with £100000 at the beginning of January. A deposit is then made of…
A: As the programming language is not mentioned here, we will be using PYTHON The complete code is…
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: (a) Write a program that begins by reading a radius, r from the user. The program will continue by…
A: Write a program to find the area of the circle and the volume of the sphere. area of the circle is…
Q: Write a program that asks the user to enter the three sides (a, b and c) of a triangle as double…
A: Answer the above question are as follows:
Q: Write a program that reads two numbers from the keyboard representing, respectively, an investment…
A: the answer is given below:-
Q: 3. Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the…
A: Take two inputs from user for height and weight convert height in meter(h*0.0254) and weight in…
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: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: ****************** Maths used to calculate the total cost ***************** miles/per states that…
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: Implement the following: Given: food1 = "Salad" food2 = "Sandwich" price1 = 3.6 price2 = 4.99 Print…
A: food1 = "Salad"food2 = "Sandwich"price1 = 3.6price2 = 4.99 print("Lunch:", food1, f"{'' : <25}",…
Q: Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours…
A: workingHours=float(input("Enter number of working hours: ")); #input working…
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: 4.20 LAB: Warm up: Automobile service cost (1) Prompt the user for an automobile service. Output…
A: Step 1: Get input from user Step 2: Print the entered input Step 3 : Check the entered input for…
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: Write a program that calculates and prints the monthly pay check for an employee. The net pay is…
A: Define header file <iostream> for i/o operations. Define header file <iomanip> for…
Q: The progressive income tax rate is mandated as follows: Taxable Income Rate (%) First $20,000 0…
A: Note: Programming language is missing in the question. So we will answer this program in Java. If…
Q: Write a program named TypingGrades that allows a user to enter a student’s number of words typed.…
A: Algorithm: Start READ numWords IF numWords<= 15 then: grade='F'ELSE IF numWords<=30 then:…
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: 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: Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length…
A:
Q: Write a simple payroll program that will display the employee's information, The program should…
A: Question given: Write a Java program that display employee's payroll information. Ask from user…
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: 2. Write a program that calculates marked area of the square, given input of square length and the…
A: You had not specified any programming language for program but As the heading is assesment is…
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: 3. Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the…
A: Prompt to enter the weight in pounds. Store the value in a variable. Prompt to enter the height in…
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: Given an airplane's acceleration and take-off speed v, you can compute the minimum runway length…
A: The given problem can be solved using simple arithmetic operations in any programming language.…
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')
PYTHON
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images
- Write a program that computes the molecular weight of a carbohydrate (ingrams per mole) based on the number of hydrogen, carbon, and oxygenatoms in the molecule. The program should prompt the user to enter thenumber of hydrogen atoms, the number of carbon atoms, and the numberof oxygen atoms. The program then prints the total combined molecularweight of all the atoms based on these individual atom weights:Atom Weight(grams I mole)H 1.00794c 12.01070 15.9994For example, the molecular weight of water (H20) is: 2(1.00794) +15.9994 = 18.01528.A county collects property taxes on the assessed value of property, which is 60 percentof its actual value. For example, if a house is valued at $158,000.00 its assessed valueis $94,800. This is the amount the homeowner pays tax on. If the tax rate is $2.64 foreach $100.00 of assessed value, the annual property tax for this house would be$2502.72.Write a program that asks the user for the actual value of a piece of property and thecurrent tax rate for each $100.00 of assessed value. The program should then calculateand display how much annual property tax the homeowner will be charged for his or herproperty. The program should also display the Property Value, the Assessed Value, andthe Tax Rate. Display all monetary values to two decimal places Run your program three times with the data below Property Value: Tax Rate$100,000.00 2.64$200,000.00 2.05$350,000.00 3.10A county collects property taxes on the assessed value of property, which is 60 percentof its actual value. For example, if a house is valued at $158,000.00 its assessed valueis $94,800. This is the amount the homeowner pays tax on. If the tax rate is $2.64 foreach $100.00 of assessed value, the annual property tax for this house would be$2502.72.Write a program that asks the user for the actual value of a piece of property and thecurrent tax rate for each $100.00 of assessed value. The program should then calculateand display how much annual property tax the homeowner will be charged for his or herproperty. The program should also display the Property Value, the Assessed Value, andthe Tax Rate. Display all monetary values to two decimal places Property Value: Tax Rate$100,000.00 2.64$200,000.00 2.05$350,000.00 3.10
- . The progressive income tax rate is mandated as follows: Taxable Income Rate (%) First $20,000 0 Next $20,000 10 Next $20,000 20 The remaining 30 For example, suppose that the taxable income is $85000, the income tax payable is $20000*0% + $20000*10% + $20000*20% + $25000*30%. Write a program called IncomeTaxCalculator that reads the taxable income (in int). The program shall calculate the income tax payable (in double); and print the result rounded to 2 decimal places. For examples, Enter the taxable income: $41234 The income tax payable is: $2246.80 Enter the taxable income: $67891 The income tax payable is: $8367.30 Enter the taxable income: $85432 The income tax payable is: $13629.60 Enter the taxable income: $12345 The income tax payable is: $0.00Write a program that prints a grocery receipt of items purchased. The program must create variables for the following items: Milk = $2.00 Eggs = $ 3.00 Bread =$4.00 Orange Juice =$3.50 Apples = $4.00 Cookies = $3.25 Water = $3.00 A coupon of $1.00 was used. use a constant for a coupon. Calculate the bill, assume that 1 unit of all items was purchased use java programming languageThe 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.
- 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')Here is a classic “introduction to computer programming” problem: Write a program that converts temperature from Fahrenheit to Celsius and vice versa. The program will accept a number (temperature) and a temperature unit designation (i.e., character F or C) from the user, and then convert the temperature into the other unit system. The program will echo the input as part of the final conversion output. The temperature units should be printed in full (Fahrenheit or Celsius). Your program should use real numbers—not integers—for both input and output. Formula: T(F) = (T(C) * 9 / 5) + 32T(C) = (T(F) − 32 ) * 5 / 9 Sample Run: This program converts Temperatures from Fahrenheit to Celsius and vice versa. Please enter your temperature: 32 Please enter the units (F/C): F A temperature of 32 degrees Fahrenheit is equivalent to 0 degrees Celsius. Do you wish another conversion? (Y/N): Y Please enter your temperature: 100 Please enter the units (F/C): C A temperature of 100 degrees Celsius is…Write a program that reads the amount of a monthly mortgage payment andthe amount still owed—the outstanding balance—and then displays theamount of the payment that goes to interest and the amount that goes toprincipal (i.e., the amount that goes to reducing the debt). Assume that theannual interest rate is 7.49 percent. Use a named constant for the interest rate.Note that payments are made monthly, so the interest is only one twelfth ofthe annual interest of 7.49 percent.
- Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f = p * (1 + i)^t • f is the future value of the account after the specified time period. • p is the present value of the account (the account's current balance). • i is the monthly interest rate. • t is the number of months. Write a program that takes the account's present value (current balance), monthly interest rate, and the number of months that the money will be left in the account as three inputs from the user. The program should pass these values to a function that returns the future value of the account, after the specified number of months. The program should print the account's future value. Look carefully at the following sample run of the program. In particular, notice the wording of the messages and the placement of…Write a program thatreads in investment amount, annual interest rate, and number of years and displaysthe future investment value using the following formula:futureInvestmentValue =investmentAmount X (1 + monthlyInterestRate)numberOfYears*12For example, if you enter amount 1000, annual interest rate 3.25%, and numberof years 1, the future investment value is 1032.98.Here is a sample run: Enter investment amount: 1000.56 ↵EnterEnter annual interest rate in percentage: 4.25↵EnterEnter number of years: 1 ↵EnterFuture value is $1043.92The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any hours over 40, are paid at 1.5 the regular hourly rate. Net pay is gross pay minus taxes (Refer to the tax table on the second page). Define a class called Employee. The class must have private attributes to store the employee's name, hourly rate, and regular (≤ 40) and overtime hours worked. The class must also have methods to perform the following tasks: A constructor to initialize the hourly rate to the minimum wage of $7.25 per hour and the hours worked (regular and overtime) to 0.0. A method to get (a setter/mutator method)⬧ the employee's name⬧ the hourly rate⬧ the hours work for the month (by the week –…