HW2.2】的更多相关文章

MODEL //yuec2 Yue Cheng package hw2; import java.io.File; import java.io.FileNotFoundException; import java.util.HashMap; import java.util.Scanner; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.co…
Fault的定义:可能导致系统或功能失效的异常条件(Abnormal condition that can cause an element or an item tofail.),可译为“故障”.   Error的定义:计算.观察或测量值或条件,与真实.规定或理论上正确的值或条件之间的差异(Discrepancy between a computed, observed or measured value or condition and the true, specified, or the…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the time zone offset to GMT: "); int offset = input.nextInt(); input.close(); long totalMi…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter v and a: "); double v = input.nextDouble(); double a = input.nextDouble(); input.close();…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter v0, v1 and t: "); double v0 = input.nextDouble(); double v1 = input.nextDouble(); double t…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the side: "); double side = input.nextDouble(); input.close(); double area = 3 * Math.pow(…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter three points for a triangle: "); double x1 = input.nextDouble(); double y1 = input.nextDou…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter x1 and y1: "); double x1 = input.nextDouble(); double y1 = input.nextDouble(); System.out.…
public class Solution { public static void main(String[] args) { char outcome; long randomNumber; while(true) { randomNumber = System.currentTimeMillis() % 91; if(randomNumber >= 65 && randomNumber <= 90) break; } outcome = (char)randomNumbe…
public class Solution { public static void main(String[] args) { System.out.println("a" + "\t" + "b" + "\t" + "pow(a, b)"); System.out.println(1 + "\t" + 2 + "\t" + (int)Math.pow(1, 2))…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the temperature in Fahrenheit: "); double temperature = input.nextDouble(); System.out.pri…
import java.util.Scanner; public class Solution { public static void main(String[] args) { final int THERMAL_CAPACITY = 4184; Scanner input = new Scanner(System.in); System.out.print("Enter the amount of water in kilograms: "); double mass = inp…
public class Solution { public static void main(String[] args) { double rate = 0.05; double balance = 100; double newBalance = balance * (1 + rate / 12); newBalance = (newBalance + balance) * (1 + rate / 12); newBalance = (newBalance + balance) * (1…
import java.util.Scanner; public class Solution { public static void main(String[] args) { final double POUND_TO_KILOGRAM = 0.45359237; final double INCH_TO_METER = 0.0254; Scanner input = new Scanner(System.in); System.out.print("Enter weight in pou…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter investment amount: "); double investmentAmount = input.nextDouble(); System.out.print(&quo…
控制台: import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter balance and interest rate(e.g., 3 for 3%): "); double balance = input.nextDouble(); d…
控制台: import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter employee's name: "); String name = input.nextLine(); System.out.print("Enter num…
import javax.swing.JOptionPane; public class Solution { public static void main(String[] args) { String amountString = JOptionPane.showInputDialog(null, "Enter an amount in int, for example 1156: ", "Input Amount", JOptionPane.QUESTION…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter an amount in int, for example 1156: "); int amount = input.nextInt(); int remainingAmount…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter an ASCII code: "); int ascii = input.nextInt(); input.close(); char ASCII = (char) ascii;…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of minutes: "); long minutes = input.nextLong(); input.close(); long hours = mi…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a number between 0 and 1000: "); int number = input.nextInt(); int sum = 0; if(number >…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the subtotal and a gratuity rate: "); double subtotal = input.nextDouble(); double gratuit…
import java.util.Scanner; public class Solution { public static void main(String[] args) { final double POUND_TO_KILOGRAM = 0.454; Scanner input = new Scanner(System.in); System.out.print("Enter a number in pounds: "); double pounds = input.next…
import java.util.Scanner; public class Solution { public static void main(String[] args) { final double INCH_TO_METER = 0.305; Scanner input = new Scanner(System.in); System.out.print("Enter a value for feet: "); double inch = input.nextDouble()…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the radius and length of a cylinder: "); double radius = input.nextDouble(); double length…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a degree in Celsius: "); double celsius = input.nextDouble(); double fahrenheit = (9.0 / 5…
Software Testing 3014218128 牛菲菲 Below are two faulty programs. Each includes a test case that results in failure.Answer the following questions (in the next slide) about each program. 1. public int findLast (int[] x, int y) {//Effects: If x==null thr…
一.作业说明 给定训练集spam_train.csv,要求根据每个ID各种属性值来判断该ID对应角色是Winner还是Losser(0.1分类). 训练集介绍: (1)CSV文件,大小为4000行X59列; (2)4000行数据对应着4000个角色,ID编号从1到4001; (3)59列数据中, 第一列为角色ID,最后一列为分类结果,即label(0.1两种),中间的57列为角色对应的57种属性值. 二.思路分析及实现 2.1 思路分析 这是一个典型的二分类问题,结合课上所学内容,决定采用Log…
MIAC的第二次作业,翻了一些fashion网站找了点灵感,重新设计了一下UI. 因为给的html里有nav之类的HTML5新特性,所以索性就不管IE的兼容了.chrome下的效果: FF下也差不多.这次作业试用了一下google font,果然好用(虽然载入速度不快&没中文),本来想用Raleway的extra light做h2字体的,发现chrome居然渲染不出它的extra light(FF正常),最后选了Josephin Sans. 其他的收获: 1. fashion网站都爱黑白配,真的…