The better these AI models get, the more this is going to happen. It's gonna turn into government versus government in regards to using proprietary and unavailable security research models to basically find flaws and vulnerabilities in other governments or companies systems. It's basically turning into a cybersecurity arms race.
This is actually a good thing. The better AI gets, the more restricted and expensive it's going to become, making it far less mainstream. This is good 👍
Question
GuJu
import java.util.*;
class Temperature{
double magnitude;
String scale;
public Temperature(double d, String S){
magnitude=d;
scale=S;
}
public String toString(){
/***********************************************************
return the temperature (magnitude and scale) as a string,
formatted with a precision of 2 digits after the decimal
(25 points)
************************************************************/
}
}
class TemperatureConverter{
public Temperature convert(Temperature t){
/**************************************************************
This method must process the received Temperature object, and
convert it to a different scale. If the received Temperature
object is a Fahrenheit temperature a corresponding Celsius
object must be created and returned. Similarly, if a Celsius
temperature object is received a corresponding Fahrenheit object
must be created and returned. The relevant formulae are:
Celsius = 5/9 * (Fahrenheit - 32)
Fahrenheit = 9/5 * Celsius + 32
(75 points)
}
}
public class TempConverterDriver{
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner kbd = new Scanner(System.in);
TemperatureConverter tc = new TemperatureConverter();
System.out.print("Enter Celsius value: ");
double c = kbd.nextDouble();
System.out.print("Enter Fahrenheit value: ");
double f = kbd.nextDouble();
Temperature t1 = new Temperature(c, "Celsius");
Temperature t2 = new Temperature(f, "Fahrenheit");
System.out.println(t1 + " ==> " + tc.convert(t1));
System.out.println(t2 + " ==> " + tc.convert(t2));
}
}
Link to comment
https://www.neowin.net/forum/topic/1076017-java-help/Share on other sites
5 answers to this question
Recommended Posts