-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQ3.java
40 lines (33 loc) · 867 Bytes
/
Q3.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
//Ranye Mclendon
//EEGR 409
//Quiz 3
//02/24/2022
//This is a program that uses a switch to display
import java.io.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Q3 {
public static void main (String[] args) throws IOException{
//declare
int gauge;
double rho;
char A,B;
//ask user to enter number
Scanner in = new Scanner(System.in);
System.out.print("Enter wire gauge: ");
gauge = in.nextInt();
//switch statement
switch(gauge){
case 12: rho = 5.211;
break;
case 14: rho = 8.285;
break;
case 16: rho = 13.170;
break;
case 18: rho = 20.950;
break;
default: System.out.println("Invalid guage\n");
}
System.out.println(gauge);
}}