-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPartA.java
executable file
·48 lines (36 loc) · 1.57 KB
/
PartA.java
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
/**
* Write a description of class PartA here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class PartA
{
public static void main(String [] args)
{
/************* Prob 1 ***********************
// write the isDivisible method below main
// test by running this segment
System.out.println("Is 8 divisible by 3? " + isDivisible(8,3));
System.out.println("Is 9 divisible by 3? " + isDivisible(9,3));
//************** End Prob 1 ******************/
/************* Prob 2 ***********************
// write the multadd method below main
// test by running this segment
System.out.println("1*2 + 3 = " + multadd(1.0, 2.0, 3.0));
// write 2 more test cases
// use multadd to compute the two expressions in part 4 of exercise 2
// HINT determine what is a, b, and c in each expression
//************** End Prob 2 ******************/
/************* Prob 3 ***********************
// write the isTriangle method below main
// HINT: use || or && to chain three logical expressions
// together
// then write some code that prints "it's a triangle"
// if the numbers 4, 1, 2 could be sides of a triangle
// or prints "not a triangle" if the numbers 4,1,2 cannot.
//
// add another test case below the first
//************** End Prob 3 ******************/
}
}