int number = 4; String movie System.out.print("My favorite movie is "); System.out.print (movie + "\n"); System.out.println("Love that film!"); System.out.println("Episode System.out.println("\\\\EPIC!////"); System.out.println("Episode "\"Star Wars\""; %3D + number + ":\n A New Hope\n"); %3D is great too!"). %3D + number +2 + a the space below, write out EXACTLY what the code fragment above will output when the program is run. including correct spacing, line breaks and punctua atch spacing carefully!
Q: Implement a Tour Planner and Budget Calculator for Holidays. Program will ask the user to enter…
A: Menu based programs are those where the user chooses one of several options and the program…
Q: How to get the initial of the last name? public static void lastInitials(String lastName) { {…
A: As much i know initial is the first letter of name So if you want initial of last name .you have to…
Q: Exercise 1 Create a method that takes a value and indicate whether it is positive or negative by a…
A: As per guidelines if multiple question posted we can answer only first 3 questions, please re-post…
Q: Complete the following program so it performs the following actions 10 times:• Generates a random…
A: import java.util.*;//Create a main class "ReviewQuestion16 public class ReviewQuestion16{ public…
Q: Computer Science PYTHON PROGRAMMING Write a program that generates a random number in the range of…
A: The python language has inbuilt functions to generate random numbers. A random number guessing game…
Q: What will the following program display?public class ReviewQuestion5{public static void…
A: Here the function myMethod is using recursion. That is the function will call itself with one value…
Q: (Prism Program) Write a program that can calculate the value of the surface area and volume of a…
A: As Programming language is not mentioned, taking C as reference. Inputs : Lenght, Width and Height…
Q: public class Password { String password; String SPECIAL_SYMBOLS = "!@#$%^&*"; public boolean…
A: import java.util.*; class Password { String password;String SPECIAL_SYMBOLS = "!@#$%^&*"; public…
Q: public class MovieRatings extends ConsoleProgram { public void run() { double movierRating =…
A: public class MovieRatings extends ConsoleProgram { public void run() { double…
Q: What can we tell by the following method header: public static int nameReverse (String name) { } the…
A: Function
Q: int x,y,z; string area x=Convert. ToInt (Consol.Writeline("Enter the x dimension")); y=Convert.…
A: v has to be declared and area has to be int ToInt is not valid method Console is used to perform…
Q: Python Programming Question
A: Program code: #Import random package import random #create randomanswers array random_answers=[]…
Q: Guess-the-number-game: Write a program that pays the game of “guess the number” as follows: Your…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: Create a flowchart for this Java program. public class QexamC { /** * @param args the command line…
A: The flowchart for the given program is:
Q: Key stroke enacted moving of a ball 1. Start (a) Write a Java program that uses the Up, ↑, Down ↓,…
A:
Q: /** * Processing Data with Loops */ public class skipChar { /** Write the method named skipChar()…
A: public class SkipChar {public static void main(String[] args) {SkipChar sk=new…
Q: using System; class Program { public static void Main(string[] args) { int number = 1; while…
A: Lets see the solution
Q: class Exam { public static void main(String[] args) { X x = new X(); System.out.printIn(x.value); }…
A: Answer : Option a Explanation : In the given code we are trying to create instance of public…
Q: Implement a Tour Planner and Budget Calculator for Holidays. Program will ask the user to enter…
A: A menu is used to take user input for an available list of choices. The menu can be printed using…
Q: Use Java language to: Declare a variable in the code below that checks if the weather temperature…
A: Here I have taken input from the user and stored the result into a variable. Next, I have converted…
Q: 1. Add a field of type CoinType to Coin.java, call it type 2. Write a constructor for Coin.java that…
A: Use a switch statement for checking the CoinType and there will be a String that is returned for…
Q: String tmpStr= "Mickey": String message "Hello "+ tmpStr: System.out.printin (message): tmpstr…
A: String tmpStr = "Mickey"; # Initialize the string tmpStr with Mickey String message = "Hello "…
Q: (Guess the Number Game) Write a program that plays “guess the number” as follows: Your program…
A: A TextBox should be used to input the Number to TextBox1 input the guess. to TextBox2…
Q: Implement a Tour Planner and Budget Calculator for Holidays. Program will ask the user to enter…
A: A switch statement is a multiway branch statement that is used when we have multiple conditions and…
Q: Problem: Develop a calculator using Methods (add, sub, mul and divide). The program should take 2…
A: ANSWER:-
Q: This program assigns values to two variables // and performs mathematical operations with them
A: Errors 1. System.out.println("adding " + x + y); The above statement concatenates the value of x and…
Q: How do I fix this Python program, so that it does not print "Bye" when program continues but it does…
A: The given python program is: #Interest Rate #This program uses input from the user to calculate the…
Q: Consider the code below that prompts the user to input values for x and for y. It then prints the…
A: Given: To rewrite the logic above so that the program prints out the biggest value contained in x,…
Q: public class TwoColors public static void main(String [] args) Scanner in = new Scanner(System.in);…
A: Code : Editable code : import java.util.Scanner;public class Main{ public static void…
Q: Implement a Tour Planner and Budget Calculator for Holidays. Program will ask the user to enter…
A: #include <stdio.h> int main(){ int budget,m,n,p,d; printf("\n Menu\n Destination…
Q: Value returning method Write a program to calculate items sale price
A: Given: Value returning method Write a program to calculate items sale price
Q: Create a method GetMin(int a, int b), which returns the smaller of two numbers. Write a program,…
A: C
Q: This is the code that needs to be corrected: // This application gets a user's name and displays a…
A: Here's your code :- // This application gets a user's name and displays a greetingimport…
Q: KEYBOARD ENTRY EXAMPLE Sample input and output for keyboard entry: Note: Your program does NOT have…
A: // Note: I have given the answer as asked in the question //Note: This is the standard solution…
Q: String statement="A good deed"; System.out.println (statement.indexof ('A')); O a. 1 O b. 0 O c. 3 O…
A: Given: Index of A
Q: Rewrite the entire program without errors (there are 6 errors)? public class Errors( public static…
A: Hello Student. Warm welcome from my side. Hope you are doing great. Here's your answer. The…
Q: Create a flowchart for this Java program. public class QexamC { /** * @param args the command line…
A: The flowchart helps in understanding and developing a program with necessary conditions. Here, a…
Q: class Output { public static void main(String args[]) { char a[] = {'a', '5', 'A', ' '};…
A: Given, The programming language used = JAVA Code: class Output { public static void…
Q: Problem: Develop a calculator using Methods (add, sub, mul and divide). The program should take 2…
A: HI THEREI AM ADDING ANSWER BELOW IN C LANGUAGEPLEASE GO THROUGH IT THANK YOU
Q: Assume that the population of Mexico is 128 million and that the population increases 1.01 percent…
A: GIVEN: import java.util.*;public class Main { public static void main(String[] args) {…
Q: Constants are variables declared with storing a value on it and this value can be changed during the…
A: Introduction Constants are not variables because these values cannot be changed throughout the…
Q: gram calculates the geometric and harmonic progression for a number entered by the user. */…
A: We need to define the functions :
Q: Calculate the number of seconds in a given number of hours input: int hours output: int seconds */…
A: Algorithm : howManySeconds function : Parameters : number of hours Step 1 : declare variable. Step…
Q: PROBLEM STATEMENT: Return a number, 1 lesser than the given number. public class Decrement{…
A: Here I have created a function named solution (). This function has one input parameter. Inside this…
Q: PROBLEM STATEMENT: Return the String "odd" if the input is odd otherwise return "even". public…
A: Required: PROBLEM STATEMENT: Return the String "odd" if the input is odd otherwise return "even".…
Q: Program Unit Score Calculator Console App Write a Python Console Application program that allows…
A: First, we will input all the marks. Then we will find the total marks by doing the summation of all…
Q: public class Test { public static void main(String[] args) { int a = 5; a += 5; } } switch(a) { case…
A: According to the information given:- We have to follow the code and find out the output.
Q: utput Format Print a single line containing the name of month. Be careful about the newline ('\n')…
A: Note: Since you have not provided the language to write the code so I am using Java language to…
Q: Problem Description Write a JAVA program that will read all words from a passage and store them in…
A: The above question is coded in java language. We will be having two files, Program.java,BST.java.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- In PyCharm, write a program that prompts the user for their name and age. Your program should then tell the user the year they were born. Here is a sample execution of the program with the user input in bold: What is your name? Amanda How old are you? 15 Hello Amanda! You were born in 2005 import datetimename = input("What is your name? ")age = int(input("How old are you? "))year = datetime.datetime.now().yearprint("Hello " +name + " you were born in "+str((year-age))) this is my code but it is only displaying in PyCharm "what is your name?" I feel something is wrongPlease write the Java code for a Time class: Leave comments as explaination for how the code work. Code: import java.util.Scanner; class Main { publicstaticvoid main(String args[]) { Scanner scan = new Scanner(System.in); String timeString; int numMeetings; System.out.print("What time is it now? "); timeString = scan.nextLine(); Time.setCurTime(timeString); System.out.print("Current time: "); Time.showCurTime(); System.out.println(); System.out.print("How many meetings do/did you have today? "); numMeetings = scan.nextInt(); scan.nextLine(); // dispose of newline character } } /* Sample Output: What time is it now? 15:45 Current time: 15:45 How many meetings do/did you have today? 5 What time is meeting #1? 16:00 What time is meeting #2? 16:50 What time is meeting #3? 9:00 What time is meeting #4? 10:00 What time is meeting #5? 15:00 Here are the times for your meetings that are later today: 16:00 16:50 Your last meeting of the day is at 16:50 What time is it now? 20:00…Create an application that generates a histogram so you can examine the frequency distribution of a collection of values visually. A random number of integers between 1 and 100 inclusive should be entered into the programme. After that, it should generate a chart like the one below, showing how many input values went between 1 and 10, 11 to 20, and so on.For each number entered, print one asterisk. 1 - 10 | ***** 11 - 20 | ** 21 - 30 | ******************* 31 - 40 | 41 - 50 | *** 51 - 60 | ******** 61 - 70 | ** 71 - 80 | ***** 81 - 90 | ******* 91 – 100 | ********
- Please write the Java code for a Time class: Leave comments as explaination for how the code work, and finish the code. Code: import java.util.Scanner; class Main { publicstaticvoid main(String args[]) { Scanner scan = new Scanner(System.in); String timeString; int numMeetings; System.out.print("What time is it now? "); timeString = scan.nextLine(); Time.setCurTime(timeString); System.out.print("Current time: "); Time.showCurTime(); System.out.println(); System.out.print("How many meetings do/did you have today? "); numMeetings = scan.nextInt(); scan.nextLine(); // dispose of newline character } } /* Sample Output: What time is it now? 15:45 Current time: 15:45 How many meetings do/did you have today? 5 What time is meeting #1? 16:00 What time is meeting #2? 16:50 What time is meeting #3? 9:00 What time is meeting #4? 10:00 What time is meeting #5? 15:00 Here are the times for your meetings that are later today: 16:00 16:50 Your last meeting of the day is at 16:50 What…java You must print the number declared double x; on the screen. With which of the following options do you know that a number in the range -9999.99999 to 9999.99999 is printed with exactly 4 decimals and that all numbers in the number are displayed? Choose an alternative: a.System.out.format ("%. 4f", x); b.System.out.format ("% 4.1f", x); c.System.out.format ("% b", x); d.System.out.format ("% s", x); e.System.out.format ("% d", x);Write a Java program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The table should include rows for all temperatures between 0 and 100 degrees Celsius that are multiples of 10 degrees Celsius.
- Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you Part 1. Given the following code. What will the output be? Date dt = new Date();long c = dt.getTime(); A. The word NULLB. Current date and timeC. Seconds since 1/1/1970D. Current dateE. Milliseconds since 1/1/1970 Part 2. Which is an acceptable instantiation of the java.util.Calendar class? A. Calendar cal = new Calendar();B. Calendar cal = new getInstance();C. Calendar cal = Calendar.getInstance();D. Calendar cal = Calendar.Calendar();E. Calendar cal = new Calendar.Calendar();Write an application that reads an integer value from the user and prints the sum ofall even integers between 2 and the input value, inclusive. Print an error message ifthe input value is less than 2. Use Java. Sample Run Examples: Example 1:the user enters 14Output: Sum: 56Example 2:the user enters 1Output: Error number must be greater than 1Write a program that asks users when their birthday is. Use information provided to give them their astrological sign. Each of the twelve signs should display a different horoscope. Use the following dates for each sign, keeping in mind that both month and day must be evaluated for an accurate result. Aries: March 21–April 20 Taurus: April 21–May 21 Gemini: May 22–June 21 Cancer: June 22–July 22 Leo: July 23–August 22 Virgo: August 23–September 23 Libra: September 24–October 23 Scorpio: October 24–November 22 Sagittarius: November 23–December 21 Capricorn: December 22–January 20 Aquarius: January 21–February 19 Pisces: February 20–March 20
- When the given integer variable numberOfTools is: less than 14, output "Small tool box". between 14 inclusive and 39 inclusive, output "Mid-sized tool box". greater than 39, output "Need wall storage". End with a newline. Ex: If the input is 13, then the output is: (in java) Given Code: import java.util.Scanner; public class ToolDetails {public static void main(String[] args) {Scanner scnr = new Scanner(System.in);int numberOfTools; numberOfTools = scnr.nextInt();Please do base coverage for code given below with two characteristics public void tick() throws SnakeHitYardWallException { long current = this.clockProvider.getTime(); long dif = current - this.time; this.time = current; if (dif >= delay) { this.yard.getSnake().move(); } }PART A. Write a program NumberShape that asks the user to enter a single-digit number and outputs the results as shown below using that number. Here are two examples (with user input shown in red): Enter a single-digit number: ex: 4 4 4 4 44 44 44 4 44 import java.util.Scanner public class NumberShape{public static void main(String[] args){Scanner input = new Scanner(System.in);System.out.println("Enter a single-digit: ");int randomNumber = input.nextInt();System.out.println( randomNumber); System.out.println(randomNumber randomNumber);System.out.print( randomNumberrandomNumber randomNumberrandomNumber);System.out.println(randomNumberrandomNumber randomNumber randomNumberrandomNumber);} }