-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimplepgoo1.java
More file actions
72 lines (55 loc) · 3.2 KB
/
Copy pathSimplepgoo1.java
File metadata and controls
72 lines (55 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import java.util.Scanner;
public class Simplepg001 {
public static void main(String[] args) {
Scanner sk= new Scanner(System.in);
// challenge a:Ask for the user's name and welcome them to an academy
// System.out.print("Write you name, please: ");
// String name= sk.nextLine();
// System.out.print("Welcome Dear"+name+",to Our Academy ");
//Challenge b :Prompt the user to enter two numbers and print their sum.
/*System.out.println("Welcome to MMD Calculator\n--Enter two numbers\nNumber one:");
int num1= sk.nextInt();
System.out.print("Number two:");
int num2= sk.nextInt();
System.out.println("Their sum is: "+(num1+num2));*/
//----Challenge c:Prompt the user to enter two numbers and perform basic
//arithmetic operations (addition, subtraction, multiplication, division, modulus).
// System.out.println("Enter First number");
// int a= sk.nextInt();
// System.out.println("Enter seconf number");
// int b= sk.nextInt();
// System.out.println("Their addition is : "+(a+b));
// System.out.println("Their subtraction is : "+(a-b));
// System.out.println("Their multiplication is : "+(a*b));
// System.out.println("Their division is : "+(a/b));
// System.out.println("Their modulus is : "+(a%b));
//----------challenge d:Prompt the user to enter two decimal numbers and print their product.
// System.out.print("Enter a decimal number:");
// float f1= sk.nextFloat();
// System.out.print("Enter second decimal number:");
// float f2= sk.nextFloat();
// System.out.println("Their product is : "+f1*f2 );
//----------challenge e:Prompt the user to enter the length and breadth of a rectangle and calculate its perimeter.
// System.out.print("Note here the length of anyside pf rectangle");
// float l=sk.nextFloat();
// System.out.println("Now note the length of its any adjacent side");
// float b=sk.nextFloat();
// System.out.println("The perimeter of the rectangle is"+(l+b)*2);
//challenge f:Prompt the user to enter the base and height of a triangle and calculate its area.
// System.out.println("Calculating the area of the triangle");
// System.out.print("Enter the base of the triangle: ");
// float b=sk.nextFloat();
// System.out.print("Enter the height of the triangle: ");
// float h=sk.nextFloat();
// System.out.println("Area of the Triangle is : "+(b*h)/2);
//----challenge g:Prompt the user to enter the principal amount, rate, and time period, and calculate the simple interest.
// System.out.println("Calculating the simple and compound intrest calculator ");
// System.out.print("Enter the Principal amount: ");
// float p=sk.nextFloat();
// System.out.print("Enter the rate per time period: ");
// float r=sk.nextFloat();
// System.out.print("Enter the time period(in years): ");
// float t=sk.nextFloat();
// System.out.println("The Simple Intrest in numbers:"+(p*r*t)/100);
}
}