Skip to content

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

IT3232-Day01-JavaBasics

πŸ“ Questions and Solutions

πŸ“Œ Question 01:

Write a Java program that prints a simple message to the console.

πŸ“Έ Output:

@Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ javac Q01_Printmsg.java @Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ java Q01_Printmsg

Hello, Welcome back to Java Programmimg!!

πŸ“Œ Question 02:

Write a Java program that prints numbers from 1 to 10.

πŸ“Έ Output:

@Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ javac Q02_Printnums.java @Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ java Q02_Printnums

1 2 3 4 5 6 7 8 9 10

πŸ“Œ Question 03:

Write a Java program that prints numbers in reverse order.

πŸ“Έ Output:

@Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ javac Q03_PrintRev.java @Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ java Q03_PrintRev

10 9 8 7 6 5 4 3 2 1

πŸ“Œ Question 04:

Write a Java program that prints all odd numbers between 1 and 20.

πŸ“Έ Output:

@Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ javac Q04_PrintOdd.java @Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ java Q04_PrintOdd

1 3 5 7 9 11 13 15 17 19

πŸ“Œ Question 05:

Write a Java program that splits numbers into two halves, and reverse them. πŸ”Ή Example: Input: 9 Output: 4 3 2 1 5 9 8 7 6 Input: 13 Output: 6 5 4 3 2 1 7 13 12 11 10 9 8

πŸ“Έ Output:

@Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ javac Q05_PrintRevLR.java @Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ java Q05_PrintRevLR

Enter a number: 9

4 3 2 1 5 9 8 7 6

@Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ java Q05_PrintRevLR

Enter a number: 13

6 5 4 3 2 1 7 13 12 11 10 9 8

πŸ“Œ Question 06:

Write a Java program that creates a Student class and calculates the average marks of 5 students.

πŸ“Έ Output:

@Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ javac Q06_StudentsList.java @Sumy2001 ➜ /workspaces/IT3232-Day01-JavaBasics (main) $ java Q06_StudentsList

Average marks: 85

πŸ“Œ Question 07:

Implement a Library System with PrintedBook, EBook, and AudioBook using inheritance, Polymorphism and encapsulation ..

πŸ“Έ Output:

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors