Skip to content

Commit 3494ccc

Browse files
committed
Completed till temperature converter
0 parents  commit 3494ccc

21 files changed

+365
-0
lines changed

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
### IntelliJ IDEA ###
2+
out/
3+
!**/src/main/**/out/
4+
!**/src/test/**/out/
5+
6+
### Eclipse ###
7+
.apt_generated
8+
.classpath
9+
.factorypath
10+
.project
11+
.settings
12+
.springBeans
13+
.sts4-cache
14+
bin/
15+
!**/src/main/**/bin/
16+
!**/src/test/**/bin/
17+
18+
### NetBeans ###
19+
/nbproject/private/
20+
/nbbuild/
21+
/dist/
22+
/nbdist/
23+
/.nb-gradle/
24+
25+
### VS Code ###
26+
.vscode/
27+
28+
### Mac OS ###
29+
.DS_Store

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Java-Programming.iml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.codewithsouma;
2+
3+
import java.util.Scanner;
4+
5+
public class AreaOfCircle {
6+
public static void main(String[] args){
7+
Scanner sc = new Scanner(System.in);
8+
System.out.print("Enter the radius: ");
9+
float radius = sc.nextFloat();
10+
float areaOfCircle = (float)(Math.PI * Math.pow(radius,2));
11+
System.out.println("Area of circle: "+areaOfCircle);
12+
}
13+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.codewithsouma;
2+
3+
import java.util.Scanner;
4+
5+
public class AreaOfTriangle {
6+
public static void main(String[] args){
7+
Scanner sc = new Scanner(System.in);
8+
System.out.print("Enter Base: ");
9+
float base = sc.nextFloat();
10+
System.out.print("Enter Height: ");
11+
float height = sc.nextFloat();
12+
13+
float areaOfTriangle = 0.5F * base * height;
14+
System.out.println("Area of Triangle: "+areaOfTriangle);
15+
16+
}
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.codewithsouma;
2+
3+
import java.util.Scanner;
4+
5+
public class ArithmeticOperator {
6+
public static void main(String[] args){
7+
Scanner sc = new Scanner(System.in);
8+
System.out.print("Enter number1: ");
9+
int number1 = sc.nextInt();
10+
System.out.print("Enter number2: ");
11+
int number2 = sc.nextInt();
12+
13+
System.out.println("Sum: "+ (number1 + number2));
14+
System.out.println("Sub: "+ (number1 - number2));
15+
System.out.println("Multiple: "+ (number1 * number2));
16+
System.out.println("Division: "+(number1 / number2));
17+
System.out.println("Remainder: "+ (number1 % number2));
18+
}
19+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.codewithsouma;
2+
3+
import java.util.Scanner;
4+
5+
public class Assigment4 {
6+
public static void main(String[] args){
7+
final int MONTHS_IN_THE_YEAR = 12;
8+
try(Scanner sc = new Scanner(System.in)){
9+
int phonePrice = 1800;//p
10+
System.out.print("Number of installments? ");
11+
int numberOfInstallment = sc.nextInt();
12+
System.out.print("Enter interest rate: ");
13+
float interestRate = sc.nextInt();
14+
15+
float monthlyInterest = interestRate / MONTHS_IN_THE_YEAR / 100;
16+
17+
double emi = phonePrice * monthlyInterest * (
18+
( Math.pow((1 + monthlyInterest), numberOfInstallment))
19+
/ (Math.pow((1 + monthlyInterest), numberOfInstallment) - 1)
20+
);
21+
22+
23+
double installmentPerMonth = (double) phonePrice / numberOfInstallment;
24+
System.out.println("Monthly installment Amount: "+emi + " euros");
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)