
Don’t forget to share with your people
Assignment: CSC 311B
1) Write a Java program that will print “Good morning Mrs Blessing.”
public class Greeting {
public static void main(String[] args) {
System.out.println(“Good morning Mrs Blessing.”);
}
}
2) Write a Java program that will sum two numbers.
import java.util.Scanner;
public class SumTwoNumbers {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print(“Enter first number: “);
int num1 = input.nextInt();
System.out.print(“Enter second number: “);
int num2 = input.nextInt();
int sum = num1 + num2;
System.out.println(“The sum is: ” + sum);
input.close();
}
}
KEEP IT simple if you have any questions chat me on WhatsApp or drop a comment