笔记
melanie萱
这个作者很懒,什么都没留下…
展开
-
2021-11-01
Computers understand only numbers, so every character has a numeric representation.The program you are given takes a character as input. Write a program to output its numeric value.Sample InputaSample Output97//Java import java.util.Scanner;class原创 2021-11-01 10:54:49 · 97 阅读 · 0 评论 -
2021-11-01
Complete and overload the doubleTheValue() method to calculate the double the value of the a and b variables.//Java public class Main { public static void main(String[] args) { int a = 5; double b = 10.2; Sys原创 2021-11-01 10:04:18 · 106 阅读 · 0 评论 -
2021-10-30
A board game company creates new board games every year. While all the games have different rules, they also are all similar in that they each have a name and a play() method.We need to create 3 different games - Monopoly, Chess and Battleships. In the pl原创 2021-10-30 08:30:20 · 106 阅读 · 0 评论 -
2021-10-28
You are writing a program that calculates interest income based on account type. If it is a saving account, 20% is added to the balance in the account. If it is a checking account, 5% more is added to the balance in the account.The program you are given原创 2021-10-28 14:00:00 · 85 阅读 · 0 评论 -
2021-10-27
Vehicles can be classified according to what energy source powers them. The program you are given has 3 vehicle classes: Vehicle, ElectricVehicle and HybridVehicle.ElectricVehicle and HybridVehicle classes are inherited from Vehicle class.Complete the pr原创 2021-10-27 22:59:38 · 86 阅读 · 0 评论 -
2021-10-27
You are developing your own photo editing application.The standard free version allows you to draw and write text on a photo. The Pro subscription has 2 more features - the ability to use effects and the ability to change resolution.Complete/fix the giv原创 2021-10-27 14:35:08 · 142 阅读 · 0 评论 -
2021-10-27
You work in finance at IT company,The program you are given takes the total income and the tax percent as input, and creates an income object with public total income, tax percent and private net revenue attributes.Complete the class by methods which wil原创 2021-10-27 14:23:12 · 113 阅读 · 0 评论 -
2021-10-27
You need a program to manage admissions for an art school. Pupils can be admitted to the school if they are over 6 years of age.You’re given a program which declares a Pupil class.TaskComplete the setAge method of the Pupil class. If the value of parame原创 2021-10-27 14:15:11 · 77 阅读 · 0 评论 -
2021-10-27
Write a program to take numbers as input and return the first number raised to the power of the second number.Sample Input24Sample Output16.0import java.util.Scanner;class Main { public static void main(String[] args) { Scanner read = new原创 2021-10-27 13:53:53 · 51 阅读 · 0 评论 -
2021-10-25
Your friend is a cashier at a movie theater. He knows that you are an awesome java developer so he asked you to help him out and create a program that gets movie title, row, and seat information and prints out a new ticket.Complete the existing code by ad原创 2021-10-25 16:17:08 · 92 阅读 · 0 评论 -
2021-10-25
We are creating our own application for taking screenshots.It has an option to set a name for screenshot-file to be saved. If user doesn’t insert a name for it while saving, program automatically sets “Screenshot” name for it.Given program should create原创 2021-10-25 13:00:49 · 85 阅读 · 0 评论 -
2021-10-25
The program you are given receives name and age of student as input.Complete the program to set the values for the corresponding attributes of the Student class and prints out the final result. If the age is <0, program should output “Invalid age” and原创 2021-10-25 12:26:28 · 140 阅读 · 0 评论 -
2021-10-25
You are a manager at company that have two employees, James and Tom.You wrote a program to calculate total employee salary: it creates two objects for workers and sets the corresponding parameters.But something is wrong. The program doesn’t provide acces原创 2021-10-25 09:20:59 · 72 阅读 · 0 评论 -
2021-10-25
You are the administrator of a hotel and must create customer information cards for your new customers. On the card, you must note the customer’s first and last name, age, and room number.The program you are given takes a guest’s data (first name, last na原创 2021-10-25 09:06:57 · 129 阅读 · 0 评论 -
2021-10-23
Create a program to show loading message to your application users.Define a class Loading which has one public method called LoadingMessage(), which should print “Loading” when called.Create an object named loading and call that method.public class Main原创 2021-10-23 06:53:13 · 84 阅读 · 0 评论 -
2021-10-22
You are an assistant on a TV show where celebrities are dancing and 4 judges evaluate their performance and give them a score between 1 and 10.The program you are given takes the scores as input.Complete the method to take them as parameters, then calcul原创 2021-10-22 09:59:00 · 79 阅读 · 0 评论 -
2021-10-22
The program you are given takes length and width of a rectangle as input.Complete the method to take them as parameters, then calculate and output the area of the rectangle.Sample Input45Sample Output20import java.util.Scanner;public class Main {原创 2021-10-22 03:39:49 · 55 阅读 · 0 评论 -
2021-10-22
public class Main {public static void main(String[] args) {int[][] matrix = {{8, 1, 6},{3, 5, 7},{4, 9, 0},};//output the numbersfor(int i=0;i<3;i++){for(int j=0;j<matrix[i].length;j++)System.out.println(matrix[i][j]);}//System.out.printl原创 2021-10-22 03:26:32 · 48 阅读 · 0 评论 -
2021-10-19
You are creating a bowling game!The given code declares a Bowling class with its constructor and addPlayer() method.Each player of the game has a name and points, and are stored in the players HashMap.The code in main takes 3 players data as input and a原创 2021-10-19 13:59:43 · 284 阅读 · 0 评论 -
2021-10-19
You are working on a graphical app, which includes multiple different shapes.The given code declares a base Shape class with an abstract area() method and a width attribute.You need to create two Shape subclasses, Square and Circle, which initialize the原创 2021-10-19 12:23:55 · 105 阅读 · 0 评论 -
2021-10-15
The binary numeric system uses only two digits: 0 and 1. Computers operate in binary, meaning they store data and perform calculations using only zeros and ones.You need to make a program to convert integer numbers to their binary representation.Create a原创 2021-10-15 23:09:59 · 48 阅读 · 0 评论 -
2021-10-08
Write a program to take a string as input and output its reverse.The given code takes a string as input and converts it into a char array, which contains letters of the string as its elements.Sample Input:hello thereSample Output:ereht ollehimport ja原创 2021-10-08 00:33:56 · 45 阅读 · 0 评论 -
2021-10-05
Your company is writing a program for a geometry course.The program takes the number of squares as the first input, creates an array, and then takes the sides of squares as its elements.Write the part of the program that receives a list of square sides a原创 2021-10-05 21:39:33 · 53 阅读 · 0 评论 -
2021-09-18
You are given a program that takes the length of the array as the first input, creates it, and then takes the next inputs as elements of the array.Complete the program to go through the array and calculate the sum of the numbers that are multiples of 4.S原创 2021-09-18 21:45:33 · 53 阅读 · 0 评论 -
2021-09-17
Loan Calculator 贷款计算器(Java练习题)You take a loan from a friend and need to calculate how much you will owe him after 3 months.You are going to pay him back 10% of the remaining loan amount each month.Create a program that takes the loan amount as input, ca原创 2021-09-17 10:45:26 · 134 阅读 · 0 评论 -
2021-09-16
You’re creating a bank security system. The user must insert the correct password in order to access payments.The password is 8819.TaskWrite a program that will continuously take a password as input and output Write password, until the client inserts th原创 2021-09-16 22:47:28 · 183 阅读 · 0 评论 -
2021-09-15
You are a game developer and the game you currently working on is a deck dealer which deals 7 cards representing the players’ roles.5 of them are good guys and 2 of them are bad guys.Write a program that will take the bad guys numbers as input and output原创 2021-09-15 18:21:10 · 63 阅读 · 0 评论 -
2021-09-14
You are given code that takes the number of students who enter the university as input. Let’s greet them!TaskComplete the program to output “Welcome” for each student.Sample Input2Sample OutputWelcomeWelcomeimport java.util.Scanner;public class原创 2021-09-14 22:59:05 · 49 阅读 · 0 评论 -
2021-09-14
A client wants you to write a program that prints all numbers from 1 to the inputted number that are either a multiplier of 3 or end with 3.Sample input14Sample output3691213import java.util.Scanner;public class Main { public static void main原创 2021-09-14 14:30:57 · 43 阅读 · 0 评论 -
2021-09-13
For your math class you need a program to calculate the factorial of a number.You’re given a program which takes a number as input.TaskComplete the program to calculate the factorial of the given number and output it.Sample input6Sample output720Ex原创 2021-09-13 06:20:24 · 56 阅读 · 0 评论 -
2021-09-11
Your robot can recognize your emotions marked with number that represents each of them:1 - You are happy!2 - You are sad!3 - You are angry!4 - You are surprised!Write a program that takes the emotion number as input and outputs the corresponding messa原创 2021-09-11 21:52:31 · 90 阅读 · 0 评论 -
2021-09-09
You are an administrator at a football club who must categorize already played games on the team’s website.The given program takes 3 inputs:match status - which checks if the match is suspended (“true”) or not suspended (“false”)your team’s scoreoppos原创 2021-09-09 00:21:37 · 85 阅读 · 0 评论 -
2021-09-07
You need a program to convert days to seconds.The given code takes the amount of days as input. Complete the code to convert it to seconds and output the result.Sample Input:12Sample Output:1036800import java.util.Scanner;public class Program { pu原创 2021-09-07 14:03:38 · 44 阅读 · 0 评论 -
2021-09-03
public class Main {public static void main(String[] args) {/So the program prints some oddnumbers and it works perfectly/System.out.println(“1”);System.out.println(“3”);System.out.println(“7”);}}原创 2021-09-03 00:21:13 · 42 阅读 · 0 评论 -
2021-09-03
public class Main {public static void main(String[] args) {//uncomment necessary line(s)//System.out.println(“Java is lame”);System.out.println(“Java is awesome”);//System.out.println(“Please uncomment me!!! ^^”);}}原创 2021-09-03 00:20:32 · 117 阅读 · 0 评论 -
2021-09-03
public class Program{public static void main(String[] args) {//print “Java is fun”System.out.println(“Java is fun”);}}原创 2021-09-03 00:15:22 · 40 阅读 · 0 评论 -
漫画进制(二)
`原创 2021-08-31 16:36:19 · 89 阅读 · 0 评论 -
2021-08-28
JavaComplete the given program to print “Java is fun”.Note that the sentence starts with a capital letter.HintJust add the text to the System.out.println() methodpublic class Program{public static void main(String[] args) {//print “Java is fun”Sys原创 2021-08-28 00:50:09 · 57 阅读 · 0 评论 -
2021-08-20
It’s time to update your Queue management system. The previous version supports only integer numbers and we need to support more types, such as strings, to store customer names in the queue.Transform the given Queue class to a class template, which can wo原创 2021-08-20 03:06:21 · 185 阅读 · 0 评论 -
2021-08-20
Your Queue class is up and working in a customer service company. The company opens up a new branch and asks you to make another version of the Queue for them. The only difference is the way the Queue is displayed: each number on a new line.You decide to原创 2021-08-20 01:31:21 · 219 阅读 · 0 评论