Made progress with module

new file:   Projects/m319-projectThree/.idea/discord.xml
	modified:   Projects/m319-projectThree/src/main/java/net/stelian/m319/projectThree/CurrencyExchange.java
	new file:   Projects/m319-projectThree/src/main/java/net/stelian/m319/projectThree/GradmassBogenmass.java
	modified:   Projects/m319-projectThree/target/classes/net/stelian/m319/projectThree/CurrencyExchange.class
	new file:   Projects/m319-projectThree/target/classes/net/stelian/m319/projectThree/GradmassBogenmass.class
This commit is contained in:
Sangelo 2023-03-07 19:38:39 +01:00
parent 9190ba199b
commit 9d3f15ca88
5 changed files with 45 additions and 12 deletions

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="APPLICATION" />
<option name="description" value="" />
</component>
</project>

View File

@ -26,20 +26,30 @@ public class CurrencyExchange {
}
public static void exchangeCalc(float amount, String currency) {
float course;
if (currency.toLowerCase() == "yen") {
course = 0; //TODO
} else if (currency.toLowerCase() == "gbp") {
} else if (currency.toLowerCase() == "usd") {
} else if (currency.toLowerCase() == "eur") {
} else if (currency.toLowerCase() == "chf") {
if (currency.equalsIgnoreCase("yen")) {
double course = 145.441;
double output = course * amount;
System.out.println(output+" "+currency);
} else if (currency.equalsIgnoreCase("gbp")) {
double course = 0.896674;
double output = course * amount;
System.out.println(output+" "+currency);
} else if (currency.equalsIgnoreCase("usd")) {
double course = 1.06236;
double output = course * amount;
System.out.println(output+" "+currency);
} else if (currency.equalsIgnoreCase("eur")) {
double course = 1.00554;
double output = course * amount;
System.out.println(output+" "+currency);
} else if (currency.equalsIgnoreCase("chf")) {
double course = 1.00;
double output = course * amount;
System.out.println(output+" "+currency);
} else {
System.out.println("Invalid currency selected: "+currency);
}
System.out.println("Date of courses: Tue Mar 7 07:21:06 PM CET 2023");
}
}
}

View File

@ -0,0 +1,16 @@
package net.stelian.m319.projectThree;
import java.util.InputMismatchException;
import java.util.Scanner;
public class GradmassBogenmass {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Please enter the angle in degrees: ");
try {
double gradmass = input.nextDouble();
double bogenmass = gradmass * (Math.PI/180);
System.out.println("Result: "+bogenmass);
} catch(InputMismatchException e) {
System.out.println("ERROR: Invalid input. Please try again.");
}
}
}