Exercise01. Write a Java program to define and call CalculateAreaCylinder(double height, double radius) function to calculate the area of three cylinders using Math class with the following specifications: first cylinder (7,6), second cylinder (4.3 ,2.5), and third cylinder (-4.5,6.9). Note the area of cylinder is calculated using the following formulae: A = 2ar + h(2 r)
Q: The U.S. Census Bureau projects population based on the following assumptions:- One birth every 7…
A: Program –// declaring the classpublic class Population{ // defining the main method public…
Q: Write a program in the Java code that modifies the function to test the number as follows: 2_If the…
A: The function toTest() ask user to enter a number which is then compared with the already initialised…
Q: Below is a program written in java. In a separate word document, go through the program line by line…
A: Code // Online Java Compiler// Use this editor to write, compile and run your Java code online…
Q: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: Here we need to define a separate method to find whether a number is perfect or not. Let it called…
Q: Finish the Java program inputNewPlayerLocation: to input (x,y) coordinates from user (using…
A: Point is the built-in java class that is available to use in java.awt package The Point class…
Q: Create a complete Java program that will determine the CGPA for the grade entered by user based on…
A:
Q: Test Case 1 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, & , 45, 44, 43,…
A: public class Main{ public static void main(String[] args) { for(int i=1;i<100;i++)//for…
Q: Required is a Java program that receives the names of 250 students via a keyboard, and their…
A: import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import…
Q: Java please give a sample code. Primary U.S. interstate highways are numbered 1-99. Odd numbers…
A: Java is one of the most popular and widely used programming language. Java has been one of the most…
Q: Write a program called TimeConvertor.java that converts times expressed in 24-hour clock to 12-hour…
A: Here are five examples of what the program should look like when it runs: i. Enter a time ([h]h:mm…
Q: Implement the design of the Travel class in python so that the following output is produced: You…
A: Algorithm: Start Implement class Travel with a static variable count and class variables…
Q: debug my program? it's in Java. At line 108, I get the error “The field Person.age is not visible”.…
A: Error found while executing your program: - Explanation: - After executing the given program the…
Q: Write a java program to print the area of a rectangle by creating a class named 'Area' having two…
A: The required Java code is given below: import java.util.Scanner;public class Area{ // class Area…
Q: Write a program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of ice…
A: I give the code in python(because you have not mentioned any particular language) and also provide…
Q: write python code design Foodcart class and Food class so that the following code provides the…
A: Algorithm: Start Create a class Foodcart with attributes cart, cartName Implement constructor to…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: Java program with total change amount in pennies as an integer input, and output the change using…
Q: Write a program in a class contructor and destructor to print two numbers and then find ? the…
A: Note: Here you didn't mention any programming language so we are writing the program in the C++…
Q: THIS IS MEANT TO BE IN JAVA So far we've learned variables, branches, loops, and some array. The…
A: Here I have taken input from the user and stored it into a variable. Next, I have checked for the…
Q: You were hired by PAGCOR as part of the programming team in-charge of automating its BINGO game.…
A: Lets see the solution.
Q: 1- Write a Java code that asks the user to enter the integer (XA, YA) Ccoordinate of a point A and…
A: import java.util.Scanner;public class Main{ public static void main(String[] args) { float a,…
Q: Draw a memory diagram of the variables of the following code after the execution of the code. Please…
A: According to the information given:- We have to draw a memory diagram of variable in the program.
Q: Write a Java program that will call a method (called f) to caluculate the following function. f(x)…
A: Given:- Write a Java program that will call a method (called f) to calculate the following function.…
Q: Write a program in Java to generate the entire calendar for one year. The program must get two…
A: the program is given below:-
Q: (A) Write a Java program that reads student scores, displays the best score, and distribution of…
A: import java.util.Scanner; public class Grade { public static void main(string args[]) { Scanner…
Q: Task 3 Implement the design of the Passenger class so that the following output is produced: The…
A: Given:
Q: Question 2: Write a java program that prompt the user for a string telephone number of the form…
A: According to the Question below the solution: Output:
Q: Write java program that will calculate the amount to be paid for electrical consumption. This…
A: Objective: This program would determine the bill amount or electricity consumption for customers.…
Q: Implement the below pseudo-code in a Java program using a while loop and a switch-case statement.…
A: //import the required package import java.util.*; //create a main class called Task public class…
Q: 1. Write a program that reads a Celsius degree in a double value from the console, then converts it…
A: Begin Take the celcius double value as input Compute the farhenheit Print value End
Q: Write a Java program that inputs three integer variables (called a, b, and c) that represent the…
A: Here I have first of all created a class Main, and inside the class, I defined an enumeration named…
Q: Write a Java program correctly that generates a report of proof of vaccination against COVID-19 for…
A: We need to write Java program for given specifications.
Q: Create a Java program with a function that accepts an object's mass (in kilograms) and velocity (in…
A: Use double datatype for m,v,E
Q: For this assignment, write a program called Payday.java that will compute and print a person's…
A: Given:
Q: Po In the space below, write the six lines of output when the following Java code fragment is run.…
A: public class Main{ public static void main(String[] args) {double go= 10;int fight = 20;int win =…
Q: 3) Write a Java program that prompts the user to enter a sentence (phrase), then it counts how many…
A: Please find the answer below :
Q: reate a java program that calculates the average test scores. Three employees in a company are ups…
A: Create a java program that calculates the average test scores. Three employees in a company are ups…
Q: Write a Java program (Class Name: VolumeDiameterSphere) to getd constant value T (value Volume and…
A: import java.util.Scanner;class Main { public static void main(String args[]) { Scanner…
Q: (3) Write a Java program that prompts the user to enter a sentence (phrase), then it counts how many…
A: import java.util.*;/*Name : K,KASI REDDY * STUDENT NO.123 */public class Main { public static…
Q: THIS IS MEANT TO BE IN JAVA So far we've learned variables, branches, loops, and some array. The…
A: calculation for gas cost:- dollars_gallon*distance1/miles_gallon take the values for car's…
Q: Write a program in JAVA to read the CGPA of student and display its type according to the following…
A: Take input from user using scanner class Check the input is between range of <1.99 to 4.00 and if…
Q: Any help with this question would really help!! Write the following exercise using Java code. Add…
A: user has to enter number of shirts according to input program calculate shipping charge price and…
Q: Write a complete Java program that prints out the following information: 1. Ask the user to enter…
A: GIVEN: Create a Java program that gets the last three digits of the student ID from the user. Then…
Q: Create a java program that calculates the average test scores. Three employees in a company are ups…
A: Java Code: import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import…
Q: Write a program to print the area of a rectangle by creating a class named 'A having two functions.…
A: GIVEN: Write a program to find the area of the rectangle using two functions. The first function…
Q: In Java: Write a program with total change amount in pennies as an integer input, and output the…
A: Program import java.util.*; public class Main { public static void main(String [] args) {…
Q: (3) Write a Java program that prompts the user to enter a sentence (phrase), then it counts how many…
A: Please find the answer below :
Q: Write a program to print the area of a rectangle by creating a class named 'Area' having two…
A: Java program to print the area of a rectangle. The name of the class is Area. This class has two…
Q: Please code this in Java. Write a program to input a phone number and output a phone directory with…
A: Hello student Please do like if this solution will help you I really work hard for getting accurate…
Q: For this assignment, write a program called Payday.java that will compute and print a person's…
A: Required: For this assignment, write a program called Payday.java that will compute and print a…
Q: In this exercise you will write a program to compute the distance between any two geo locations. In…
A: Given that, write a program to compute the distance between any two geo-locations. In this program,…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write a complete Java program that performs the following tasks: Ask the user to enter the last two digits of his/her student ID. Break the number into two digits using arithmetic operators, then store the first and second digits in integer variables named digit1 and digit2 Find and print the following: The product of digit1 and digit2. The sum of digit1 and digit2 The average of digit1 and digit2 The maximum of the two numbers; digit1 digit2 using a method from the class Math. Note: The class name of your Java program must be your first name. Your answer should have the code as text as well as the screenshot of the program output (using your own student ID) as a part of your answer. Otherwise, zero marks will be awarded.Create a Javascript function that takes a numeral (just digits without separators (e.g. 19093 instead of 19,093) and returns the standard way of reading a number, complete with punctuationin Java Write a program that establishes two savings accounts with saver1 having account number10002 with an initial balance of $2,000, and saver2 having account 10003 with an initialbalance of $3,000. Set a common rate of interest at 5% per year. At the end of each month,update the balance by adding one month’s interest to the balance, so that the balancecompounds monthly. Print an output that displays the month number and the account numberand the balance for each of the two accounts. Use month 0 to display the initial balances, month1 to display the balances after the first month’s interest, and so on. At the end of the year,display the total balance for both accounts combined, like this:Output:Monthly balances for one year with 0.05 annual interest:Month Account # Balance Account # Balance----- --------- ------- --------- ------- 0 10002 2000.00 10003 3000.00 1 10002 2008.33 10003 3012.50 2 10002 2016.70 10003 3025.05 3 10002 2025.10 10003 3037.66 4 10002 2033.54 10003 3050.31 5…
- Create a java program that calculates the average test scores. Three employees in a company are ups for a special pay increase. You are given a file; ABCompany.txt, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee’s last name, first name. Current salary and percent pay increase. For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87 and the pay increase is 5%. Write a program that reads the data from the specified file and stores the output in the file ABCoutput.dat. For each employee, the data must be output in the following form: firstname lastname updated salary. Format the output of decimal numbers to two decimal places. Send a copy of the following: the java code Screenshot of the results screenshot of input file screenshot of output fileCreate a java program that calculates the average test scores. Three employees in a company are ups for a special pay increase. You are given a file; ABCompany.txt, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee’s last name, first name. Current salary and percent pay increase. For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87 and the pay increase is 5%. Write a program that reads the data from the specified file and stores the output in the file ABCoutput.dat. For each employee, the data must be output in the following form: firstname lastname updated salary. Format the output of decimal numbers to two decimal places. Send a copy of the following: the java code code Screenshot of the code screenshot of input file screenshot of output fileJava Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. For coding simplicity, output a space after every integer, including the last. Ex: If the input is: -15 30 the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first.
- Write a Java regular expression for each of the following: a. Phone numbers, such as (609) 555-1234 b. Social Security numbers, such as 123-45-6789 c. Dates, such as December 31, 1999Java. Examine the following code: What is the scope of the variable number? (Type your answer as two line numbers with a comma between. For example if a variable's scope would go from lines 5 to 10, you would type 5, 10.)Write a Java program correctly that generates a report of proof of vaccination against COVID-19 for the peoplewho received their dose of vaccination. Write a program which:1. Display a welcome message.2. Then prompts the user to enter the following:• First name, with first letter uppercase, which is then stores in a variable of type String.• Last name, with first letter uppercase which is then stores in a variable of type String.• Day of birth, set as a number between 1 and 31, which is then stores in a variable of typeint.• Month of birth, set as a number between 1 and 12, which is then stores in a variable of typeint.• Year of birth, set as a number between 1920 and 2006, which is then stores in a variable oftype int.• Day of vaccination, set as a number between 1 and 31, which is then stores in a variable oftype int.• Month of vaccination. set as a number between 1 and 12, which is then stores in a variableof type int.• Year of vaccination, set as a number between 2020 and 2021,…
- Modify the command-line argument example Hello.java, to handle a few command-line arguments. Ask the user to enter a name followed by a number. The program should print out the name N times, while N is the input number. For example, if the command-line input is Java Hello Jim R. Joseph 5 Then the output should be: Jim R. JosephJim R. JosephJim R. JosephJim R. JosephJim R. JosephIn this exercise you will write a program to compute the distance between any two geo locations. In this program you will ask the user for four numbers. USE JAVA starting latitude starting longitude ending latitude ending longitude Then, using the GeoLocation class and our earlier example as a reference, compute the distance in miles between the two locations. A sample program run should match exactly as below: Enter the latitude of the starting location: 48.8567 Enter the longitude of the starting location: 2.3508 Enter the latitude of the ending location: 51.5072 Enter the longitude of the ending location: 0.1275 The distance is 208.08639358288565 miles.Hello, Please write a Calculator program in Java using the JavaFX libraries as we discussed in class. At a minimum, your calculator should handle addition, subtraction, multiplication and division of integer numbers. So basically you should be able to input a number, click an operation (+ - * /) button, then enter another number and hit = and you should see the result show up in the calculator display. For part 2 add the functionality to the buttons. So that as a minimum your calculator programs should be able to handle the user inputting a multi digit integer, press + or - or * or /, then input another multi digit integer and then press the = button and the answer gets printed in the text label in your Calculator GUI.