Cit 207 - Project
Cit 207 - Project
import java.util.Scanner;
public class Describeyourself {
public static void main(String[]args) {
Scanner scanner = new Scanner (System.in);
package Lorega;
import java.util.Scanner;
public class Activity2 {
//addition operation//
System.out.println("a + b + c= " + (a + b + c));
//multiplication operation//
System.out.println("a * b * c= " + (a * b * c));
//subtraction operation//
System.out.println("a - b - c= " + (a - b - c));
//division operation//
System.out.println("a / b / c= " + (a / b / c));
}
}
package Lorega;
import java.util.Scanner;
public class Activity3{
else {
System.out.println("Failed");
}
}
}
package Lorega;
import java.util.Scanner;
public class Activity4 {
while (true) {
String trashType = scanner.nextLine();
if (trashType.equals("exit")) {
break;}
switch (trashType) {
case "Red":
System.out.println("The garbage is NON-BIODEGRADABLE.");
break;
case "Yellow":
System.out.println("The garbage is BIODEGRADABLE.");
break;
case "Green":
System.out.println("The garbage is RECYCLABLE.");
break;
case "Black": System.out.println("The garbage is RESIDUAL.");
break;
default: System.out.println("Invalid input. Please enter 'Red', 'Yellow',
'Green', 'Black' or 'exit'.");
break;
}
}
System.out.println("Thank you for the Trash Segregation!"); scanner.close();
}
}
package Lorega;
import java.util.Scanner;
public class Activity5 {
public static void main(String[] args)
{
int rows, colummns, x , y;
Scanner s = new Scanner(System.in);
System.out.print("Please Enter Number of Rows:");
rows = s.nextInt();
System.out.print("Please Enter Number of Colummns: ");
colummns = s.nextInt();
for (x = 1 ; x <= rows; x++)
{
for (y = 1 ; y <= colummns; y++)
{
System.out.print("*");
}
System.out.print("\n");
}
}
package Lorega;
import java.util.Scanner;
public class Activity6 {
public static void main(String[] args)
{
int rows, colummns, x , y;
Scanner s = new Scanner(System.in);
System.out.print("Please Enter Number of Rows:");
rows = s.nextInt();
System.out.print("Please Enter Number of Colummns: ");
colummns = s.nextInt();
for (x = 1 ; x <= rows; x++)
{
for (y = 1 ; y <= colummns; y++)
{
System.out.print("*");
}
System.out.print("\n");
}
}
}
package Lorega;
import java.util.Scanner;
public class Activity7 {
do {
System.out.print(" * ");
i++;
} while (i <= rows);
do {
System.out.print(" \n ");
j++;
} while (j <= columns);
}
}