Write a script with an "elif" ladder Set a variable called count. Ask user to enter a value for count. The script will display "The value is 100", "The value is greater than 100" and "The value is less than 100" depending on its value.
Q: In this assignment you will use the MyString class that you wrote earlier in this course. A…
A: The correct answer for the above mentioned question is given in the following steps for your…
Q: /** * A Java program to input strings and call methods strings. * * Note: Codecheck will use…
A: Code scenario to perform using JAVA : Take user input for string with multiple words Then print it…
Q: def getInput(): return int(input("Enter a call number: ")) def findBook (callNumber): if callNumber>…
A: In the above question, we have to write a python code which will return the book location. Using…
Q: Write a program that asks the user to enter a 1st color choice from a set of options: red, yellow or…
A: In this program we have to enter a 1st color choice from a set of options: red, yellow or blue,…
Q: Verify User: The final listing for remember_me.py assumes either that the user has already entered…
A: Algorithm : 1. Start 2. Get the user's username. 3. Prompt the user with a question asking if the…
Q: 1. Generate a number of random integer values within a given range Requirements: - Ask the user…
A: Step 1:- Program Approach:- 1.Declare the 3 variable of type integer 2.Declare the variable of a…
Q: Write a console-based application that displays every perfect number from 1 through 10000. A number…
A: The C# code using System; namespace PerfectNumberApp { class Program { static bool…
Q: You have to create a winform desktop application that can be used by a small theater to sell tickets…
A: /* program for the given question*/ /A program that asks the user for input to buy theater seats.…
Q: Write a program that prompts the user to enter three cities and displays them in ascending order.
A: #include<iostream>#include<string.h>using namespace std;int main(){char nameAll[5][20],…
Q: Write a code snippet to prompt a user to enter two words. Then, pass these values as parameters in a…
A: Start. Read two words. Pass these two to the functions. Check for the number of upper and lowercase…
Q: A class plays a fishing game in which a large tub is filled with plastic fish that are identical,…
A: 1. Data in a dot plot:
Q: Given a string, create a new string with all the consecutive duplicates removed. #assign the result…
A: Answer:
Q: Write an application that accepts three Strings from the user and displays them in alphabetical…
A: Note: Below is the required program in java language. Programming Approach: Import necessary…
Q: Write an application that determines the value of the coins in a jar and prints the total in dollars…
A: As the programming language is not mentioned hee, we are using Python The Python code is given below…
Q: At a certain university, students have to submit their exams online. The administration decides that…
A: Code import java.util.*;public class Main{ public static void main(String[] args) { int…
Q: Design and implement an application that prints the first few verses of the traveling song “One…
A: Algorithm for 100 Bottles of Beer 1. Prompt the user to enter a positive integer. 2. Loop from 0…
Q: Write a program that generates a random number in the range of 1 through 100, and asks the user to…
A: The answer for the above mentioned question is given in the following steps for your reference.
Q: 0-6. Addition: One common problem when prompting for numerical input occurs when people provide text…
A: Solution1- Accorrding to first problm , we have created a python code using try function . In given…
Q: In Blue j Write a program in the Tips class that reads the subtotal and the gratuity rate from…
A: if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity…
Q: Compare userNumber with compareNumber and display 'Numbers are not equal' if the numbers are…
A: 1. Define a variable named compareNumber and set it to a numeric value (e.g., 3).2. Define a…
Q: Mark Daniels is a carpenter who creates personalized house signs. He wants an application to…
A: Sure, here is a solution in C++:
Q: discount chart should have three columns. The first column lists the items’ original price tag in…
A: Code: import java.util.Scanner;class Main{ public static double getValidPriceTag(Scanner…
Q: e method which take a string parameter. Method must be named hasRepeat and string parameter. Don't…
A: note here we are treating the capital letters and small letters are same i.e A and a are considered…
Q: In this assignment you will write a program that shows the valid moves of chess pieces. Your program…
A: C++ Code : bool isValid(int c[][MAX], int n){ int a[] = { 0, -1, 0, 1 }; int b[] = { 1, 0, -1, 0…
Q: Implement the EvenOdd application that asks a user to enter an integer. Display a statement that…
A: Here is the approach : Create the method to check if the number is even or odd . First take the…
Q: ou have been tasked with creating a program to manage a small library. The library has the following…
A: Algorithm: Step 1 Start. Step 2 Define a dictionary called "books" with book titles as keys and…
Q: Create a package called Adoption Center with the two classes Petinfo.java and PetOwnerInfo.java…
A: The PetInfo class is a java class that contains the 4 arguments Name Type Age Weight The…
Q: One common problem when prompting for numerical input occurs when people provide text instead of…
A: Code Sample Outputs
Q: The language is C# Write a program named TestScoreList that accepts eight int values representing…
A: Program: using System;//using static System.Console; class TestScoreList{static void Main(){int…
Q: In C++ please, using basic programming one coding The main menu should show the available…
A: C++ is a cross-platform language that can be used to create high-performance applications, and it…
Q: Write a method that takes three integers and returns true if their sum is divisible by 3, false…
A: Note: We can answer only 3 at a time by Bartleby's Guideline using System; namespace Sample{ class…
Q: uppose you have a certain amount of money in a savings account that earns compound monthly…
A: According to the information given:- We have to follow the instruction to get desired outcome.
Q: 01: The local Driver's License Office has asked you to write a program that grades the writ- ten…
A: Below is the complete solution with explanation in detail for the given question. Note:- Here, the…
Q: Write a program that generates a random number in the range of 1 through 100, and asks the user to…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C FOR THE SOLUTION. Define…
Q: Write a program that generates a random number in the range of 1 through 1000, and asks the user to…
A: Inside the check_guess function with parameter random_number and user_guess :If user guess is less…
Step by step
Solved in 4 steps with 2 images
- ShowCurrentTime.py, gives a program that displays the current time in GMT. Revise the program so that it prompts the user to enter the time zone in hours away from (offset to) GMT and displays the time in the specified time zone.Write an application that counts by five from 5 through 500 inclusive and that starts a new line after every multiple of 50 (50,100,150 and so on).Save the file as CountByAnything.javaIn java: ( no stringbuild or chart.append) the program must produce a neatly labeled bar chart depicting the relative values to each other. Note that there is no interactive input and no use of command line arguments. The program at this stage uses values programmed directly into it. The program output must include the original values as well as the bars. The example below shows the relative number of performances of some Broadway musicals (in picture) You choose the width of the chart. In the example above, it's 60, but it can be different. The largest value in your set should use the entire width, the rest of the bars will be proportionately shorter. Since you're assigning the values in the program, you know the maximum and no special logic is required to find it You must compute and display the "scale" of the chart (i.e. how many units one bar symbol represents) Each bar is labeled with the entity and value You may choose any symbol for your bars 3. In…
- A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures out if a user entered date is a magic date. The dates must be between 1 - 31, inclusive and the months between 1 - 12, inclusive. Let the user know whether they entered a magic date. If the input parameters are not valid, return false. examples: magicDate(6, 10, 60) -> truemagicDate(50, 12, 600) -> falseX609: Magic Date A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures out if a user entered date is a magic date. The dates must be between 1 - 31, inclusive and the months between 1 - 12, inclusive. Let the user know whether they entered a magic date. If the input parameters are not valid, return false. Examples: magicDate(6, 10, 60) -> true magicDate(50, 12, 600) –> falseWrite a program that will simulate a simple calculator. There will be four options: add two numbers, subtract two numbers, square root and raise to the power. During the subtraction option, you should not get any negative numbers when subtracting. For example, if we subtract 4 -7 you should get 3 not negative 3. Tip: use the absolute value function. You will use a switch case statement to create the selection mechanism. You will use three predefined functions we have used from chapter 4. The program will loop as long as the user types in Y or y for yes. You must include comments, failure to do so will vastly affect your grade. Once you are done, submit in a .cpp file. You do not need to show me the running program. I will check to see that it runs as l am grading your lab. Select a an option (1-4) from the following 1. Addition of two number 2. subtraction of two positive numbers 3. Square root of a number 4. Raise to the power 1 You chose to add two number Enter the first number 2…
- Assignment #6 Download the partially completed program Project06.py. Prompt the user to enter appropriate data in order to calculate the area of the shape. Display the area of the shape with output labelled. For example: A square with sides 5.0 has an area of 25.0. A triangle with base 8.0 and height 15.0 has an area of 60.0. The formulae for the area of the shapes are: circle-radius', square - side, rectangle -length*width, triangle-0.5 base* height The program should check for negative value inputs. If a negative value is inputted, a message like "Invalid input value. Program is terminated." import math print("Let's calculate the area of a shape! \n") shape input ("Make your choice (circle/square/rectangle/triangle): ").lower()The Nim game. Write a program for a two-player version of the game Nim: a human player will play against the computer. The game is simple: players take turns removing from 1 to 4 sticks from a pile of 13 sticks; the player who picks up the last stick wins the game. Here’s some pseudocode for the Nim game. Start by initializing some variables that will allow you to keep track of the state of the game: One variable should record how many sticks there are left in the pile; initially, this variable must be initialized to 13. There are two players in the game, who take turns. To remember who’s turn is next, use a variable with two states (= values). Say the variable is 1 if the human player is next, and it is 2, if the computer’s turn is next. Pick randomly the player who should start the game. Then, start the main loop of the game: the game should continue for as long as there still are sticks (at least one) to pick. In each repetition of the game loop, one player will play their turn:…LAB ASSIGNMENTS, CONT. 2. sandwich.py - follow the instructions below. You may adjust the food items to include your personal favorites. • It uses all of our standard mipo_ex features. • The menu should have numbered or letter options. Sandwich Maker Write a program that asks users for their sandwich preferences. The program should use PylnputPlus to ensure that they enter valid input, such as: Using inputMenu() for a bread type: wheat, white, or sourdough. Using inputMenu() for a protein type: chicken, turkey, ham, or tofu. Using inputYesNo() to ask if they want cheese. If so, using inputMenu() to ask for a cheese type: cheddar, Swiss, or mozzarella. Using inputYesNo() to ask if they want mayo, mustard, lettuce, or tomato. Using inputlnt() to ask how many sandwiches they want. Make sure this number is 1 or 120 00T 110 more. Come up with prices for each of these options, and have your program display all the choices and their prices plus a total cost at the very end. 3 130
- Write an application in which the user can enter a date using digits and slashes (for example, "6/24/2012"), and receive output that displays the date with the month shown as a word (such as “June 24, 2012"). Allow for the fact that the user might or might not precede a month or day number with a zero (for example, the user might type "06/24/2012" or “6/24/2012"). Do not allow the user to enter an invalid date, defined as one for which the month is less than 1 or more than 12, or one for which the day number is less than 1 or greater than the number of days in the specified month. Also display the date's ordinal position in the year; for example, 6/24 is the 176th day. In this application, use your knowledge of arrays to store the month names, as well as values for the number of days in each month so that you can calculate the number of days that have passed. Figure shows the output when the user has entered 6/24/2012. Save the application as Date.java Input Enter a date in the format…Write the part of the program that searches for the name of the coffee add-in(s) and either prints the name and price of the add-in or prints the error message if the add-in is not found. Comments in the code tell you where to write the statements. Write the code that searches the list for the name of the add-in ordered by the customer. Write the code that prints the name and price of the add-in or the error message, and then write the code that prints the cost of the total order. Execute the program using the following data and verify that the output is correct: Cream Caramel Whiskey chocolate Chocolate Cinnamon Vanilla # JumpinJava.py - This program looks up and prints the names and prices of coffee orders. # Input: Interactive # Output: Name and price of coffee orders or error message if add-in is not found # Declare variables. NUM_ITEMS = 5 # Named constant # Initialized list of add-ins addIns = ["Cream", "Cinnamon", "Chocolate", "Amaretto", "Whiskey"] #…