if age < 16: print ("Cannot get a driver's license") if age >- 16: print("Can get a driver's license") if age < 16: print("Cannot get a driver's license") else: print("Can get a driver's license") (a) (b)
Q: 12- With the following declaration: int [.] points = {{300, 100, 200, 400, 600}, {550, 700, 900,…
A: Here we are declaring a 2D array with 2 rows and 5 columns. As we know that array can be accessed…
Q: (Financial application: payroll) Write a program that reads the following infor- mation and prints a…
A: CODE:- # Get the employee's namename = input("Enter employee's name: ")# Get the number of hours…
Q: (Financial application: calculate future investment value) Write a program that reads in an…
A: The program is written in Java. Please find the program in step 2.
Q: Write an application that prompts the user for a password that contains at least two uppercase…
A: Syntax: do { // Loop-body } while ( Condition ) ; Flowchart:
Q: public void setQuantity(int quantity}{ minimum quantity is 10 if invalid set it to 10 if(quantity <…
A: Given: Fill in the blanks.
Q: Body Mass Index (BM) is a measure of health on weight. It can be calculated by taking your weight in…
A: Here is the java code. See below step for code.
Q: Write a program that asks the user to enter a number of seconds. -There are 60 seconds in a minute.…
A: The below given Java program will obey the following rubrics: Importing required package. Defining…
Q: 1.Balloon Emporium sells both latex and Mylar balloons. The store owner wants a pro-gram that allows…
A: Answer:-
Q: 3.17 (Game: scissor, rock, paper) Write a program that plays the popular scissor–rock–paper game.…
A: Answer :
Q: TOPICS: Data and Expressions MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST…
A:
Q: Enter your nickname: Gi Enter an integer: 19 Enter an integer: 4 Good day, Gi. If you divide 19 by 4…
A: nick_name = input("Enter your Nick name: ")dividend = int(input("Enter Integer: "))devisor =…
Q: Assume that qty and salesReps are both integers. Use a type cast expression to rewrite the following…
A: Assume that qty and salesReps are both integers. Use a type cast expression to rewrite the following…
Q: (Financial application: compare loans with various interest rates) Write a program that lets the…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: Write a program that prompts the user to enter the number of hours a car is parked at the airport…
A: Assuming the formula, Parking fee, F is calculated as 5, 0 ≤ h ≤3F = {6 ×int (h+1),…
Q: (Geometry: great circle distance) The great circle distance is the distance between two points on…
A: The Java program is written where it takes the latitude and longitude degrees from the user for the…
Q: Calculate the number of pounds and ounces in a given number of ounces. (16 ozs to a lb) Assume…
A: import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new…
Q: 1- Get a number from user. 2- If the number is not divisible by 5 then find out how much more you…
A: Summary: In this question, we have to write a program in C++. In the program, we have to take a…
Q: 1. Kilometer Converter Write a program that asks the user to enter a distance in kilometers, then…
A: Both python programs are coded in the next steps.
Q: Correct the following code. Keep the first line of code (double* getValue () {) double getValue() {…
A: “Since you have asked multiple question, we will solve the first question for you. If youwant any…
Q: (Financial application: calculate tips) Write a program that reads the subtotal and the gratuity…
A: //Whenever if you asked programming related questions you should always have to specify in which…
Q: Department Program Maps Student Services Academics Career Department 444 01 Week-7 Test-2 (10%…
A: Explanation of the code is given by the comments in the code itself. NOTE: The file name should be…
Q: Widgets and Gizmos An online retailer sells two products: widgets and gizmos. Each widget weighs 75…
A: code is given below:
Q: 4. (Calory.java) Write a program that asks the user to enter the number of calories and fat grams in…
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function.…
Q: Description Note: You must use the values given and you must not "hard-code" results. Write a Java…
A: logic:- read n if n>=18 display “person can vote” else display “person cannot vote” end.
Q: Twin primes are a pair of prime numbers that differ by 2. Forexample, 3 and 5 are twin primes, 5 and…
A: Program: //include header file import java.util.Scanner; //definition of main class public class…
Q: Q1) Write the pseudocode for the following. a. Ask a user to enter a number. If the number is…
A: Pseudo codes are way to write an algorithm without using the specific features of a particular…
Q: TOPICS: Data and Expressions MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST…
A: logic:- read numerator and denominator While dividing numerator and denominator type cast any one…
Q: Show the output of the following code:
A: a> ans: Program a after execution ,its output will be null. Because we have given amount=5;…
Q: .35 (Sides of a Triangle) Write an application that reads three nonzero values entered by the user…
A: #include <iostream>using namespace std; int main(){ double a, b, c;…
Q: Activities at Lake LazyDays As activity directory at Lake LazyDays Resort, it is your job to suggest…
A: ANSWER:-
Q: The following code intends to input a user’s first name, last name, and age.However, it has an…
A: Corrected Code: #include <iostream>#include <string.h>using namespace std; int main(){…
Q: (Display the day and remaining hours) Write a program that prompts the user to enter the day number…
A: Given:- (Display the day and remaining hours) Write a program that prompts the user to enter the day…
Q: (Physics: acceleration) Average acceleration is defined as the change of velocity divided by the…
A: Precise Acceleration is characterized as the time pace of progress of rakish speed. It is normally…
Q: Write a loan calculator program that computes both monthly and total payments for a given loan…
A: As no language was mentioned, So, solving with C++. #include<iostream> using namespace std;…
Q: Write method IsEven that uses the remainder operator (%) to determine whether an integer is even.…
A: Program : import java.util.Scanner; public class Main { public static boolean isEven(int z){…
Q: What is the difference between these two statements? void showValues(int num) void showValues(int…
A: Function overloading: One name multiple forms are the feature of the function overloading. A single…
Q: ++ program int quadrant() This method will return at which quadrant does this point lie in our…
A: Required: C++ program int quadrant() This method will return at which quadrant does this point lie…
Q: 5-WRITE A PROGRAM THAT CALCULATES A STUDENT'S AVERAGE IF IT IS LESS THAN 50, SPECIFYING THE…
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other…
Q: (Health application: BMI) Body Mass Index (BMI) is a measure of health on weight. It can be…
A: Code import java.util.Scanner;public class test{ public static void main(String args[]){…
Q: Q4: (Find the two lowest scores) Write a program that prompts the user to enter the number of…
A: GIVEN: Create a Java program that prompts the user to enter the number of students and each…
Q: Body mass index (BMI) is a measure of health based on weight. It can be calculated by taking your…
A: Given: Body mass index (BMI) is a measure of health based on weight. It can be calculated by taking…
Q: (Financial application: calculate future investment value) Write a program that reads in an…
A: Convert the interest rate from annual interest rate to monthly interest rate
Q: 1-Write a program that will ask the user to enter an integer number and display the (even and…
A: here in this question we have asked to write a program which take an input integer and based on this…
Q: Day of the Week Calculator For this assignment you will write a program that will allow you to enter…
A: Code: import java.util.Scanner; public class test { static String days[]=…
Q: Credit Card Number Check. The last digit of a credit card number is the check digit, which protects…
A: Program approach: import the necessary packages required for scanning the input from user create a…
Q: Parse String that look like below: cookies>mile>fudge:cake:ice cream Display the food item in…
A: Algorithm: 1.Import util package for Scanner class 2.create a class called Main 3.Take User_input…
Q: Credit Card Number Check. The last digit of a credit card number is the check digit, which protects…
A: Actually, the code has given below:
Q: (Simple computation) The formula for computing the discriminant of a quadratic equation ax^2 + bx +…
A: class Exercise01_01Extra { public static void main(String[] args) { // Declaring variables…
Q: Last month Joe purchased 100 shares of stock. Here are the details of the purchase: • When Joe…
A: Given: Last month Joe purchased 100 shares of stock. Here are the details of the purchase: • When…
Are the following statements correct? Which one is better?
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- def calculate_growth_cycle(plant_name): if(plant_name == "strawberry"): print("### The life cycle of a strawberry ###\nA seed takes 110 days to reach maturity.") elif(plant_name == "cucumber"): print("### The life cycle of a cucumber ###\nA seed takes 76 days to reach maturity.") elif(plant_name == "potato"): print("### The life cycle of a potato ###\nA seed takes 120 days to reach maturity.") else: print('Your plant is available, please try "strawberry", "cucumber" or "potato"') Plants Growth Cycle Learning Objectives In this lab, you will practice: Defining a function to match the given specifications Calling the function in your program Using if statements (can combine them with dictionaries) Instructions For every plant, there is a growth cycle. The number of days that it takes starting from being a seed and ending in being a fruit is what is called the growth cycle. Write a function that takes a plant's name as an argument and…QUESTION 21 int x1=200; int y1=3003; int z1, z2, z3, z4; int d1, d2, d3; _asm{ mov EAX, x1; 200 mov EBX, y1; 300 mov z1, ESP; assume initial ESP: OFFF FFEA add EAX, x1; 400 push EAX; mov d1, EAX:400 mov z2, ESP; push EBX; SUB EBX, x1; 300-200=100 mov d2, EBX; mov 23, ESP; POP ECX; MOV d3, ECX; MOV z4, ESP; POP EDX; mov d4, EDX; What is z3 in Hexidecimal? O OFFF FFEA O OFFF FFE6 OFFF FFE2 OFFF FFEEUsernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"] Write a function nameValidation which receives a String argument name. This function: has name String…
- T/F 2) The following method lacks a base case.public int noBaseCase(int x){if(x > 0)return noBaseCase(x – 1) + 1;else return noBaseCase(x – 2) + 2;}Usernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"] Write a function registerName which receives a String username and it returns a string message. This…Usernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"]
- def main(): monthlySales = getSales() printbonus=print_bonus(storeAmount,empAmount) #This function gets the monthly salesdef getSales(): monthlySales = float(input('Enter the monthly sales $')) monthlySales = getSales() #call to get sales salesIncrease = getIncrease(monthlySales) return monthlySales #This function gets the percent of increase in salesdef getIncrease(monthlySales): storeAmount = storeBonus(monthlySales) salesIncrease = float(input('Enter percent of sales increase: ')) salesIncrease = float(salesIncrease) salesIncrease = salesIncrease / 100 return salesIncrease #This function determines the storeAmount bonusdef storeBonus(monthlySales): if monthlySales >= 110000: storeAmount = 6000 elif monthlySales >= 100000: storeAmount = 5000 elif monthlySales >= 90000: storeAmount = 4000 elif monthlySales >=80000: storeAmount = 3000 else: storeAmount = 0 return storeAmount #This function…C++ A dice game called "21" It is a variation on BlackJack where one player plays against the computer trying to get 21 or as close to 21 without going over. Here are the rules of the game: You will play with dice that have numbers from 1 to 11. To win, the player or the computer has to get to 21, or as close as possible without going over. If the player or computer goes over 21, they instantly lose. If there is a tie, the computer wins. Starting the game: The player is asked to give the computer a name. For now, we'll simply call the computer opponent, "computer." The game starts with rolling four dice. The first two dice are for the player. These two dice are added up and the total outputted to the screen. The other two dice are for the computer. Likewise, their total is outputted to the screen. Player: If a total of 21 has been reached by either the player or the computer, the game instantly stops and the winner is declared. Otherwise, the player is asked if they…Triple the Distance Use a augmented assignment operator to triple the integer value stored in the variable distance. Assume that distance already has a value.
- Visual Basic For tax purposes an item may be depreciated over a period of several years, n.With the straight line method of depreciation, each year the item depreciates by 1/nth of itsoriginal value. With the double declining balance method of depreciation, each year the itemdepreciates by 2/nths of its value at the beginning of that year. (In the final year it is depreciatedby its value at the beginning of the year.)Write a program that performs the following tasks:1.1 Request a depreciation of the item, the year of purchase, the cost of the item, the number ofyears to be depreciated (estimated life), and the method of depreciation. The method ofdepreciation should be chosen by clicking on one of two buttons.1.2 Display a year by year description of the depreciation.C# (Sharp): Make a console application that will ask user for a name and age. If the age is less than or equal to 64, display the message: Hello <name> since you are <age> years old, you are not of retirement age. If the age is greater than 64, display the message: Hello <name> since you are <age> years old, you are ready for retirement. *** Make sure to substitute <name> and <age> with inputs ***Visual Basic For tax purposes an item may be depreciated over a period of several years, n.With the straight line method of depreciation, each year the item depreciates by 1/nth of itsoriginal value. With the double declining balance method of depreciation, each year the itemdepreciates by 2/nths of its value at the beginning of that year. (In the final year it is depreciatedby its value at the beginning of the year.)Write a program using Visual Basic that performs the following tasks:1.1 Request a depreciation of the item, the year of purchase, the cost of the item, the number ofyears to be depreciated (estimated life), and the method of depreciation. The method ofdepreciation should be chosen by clicking on one of two buttons.1.2 Display a year by year description of the depreciation.