Today we went over primitive types and reviewed their uses in a kahoot. We also learned about type casting, Strings, and we introduced the concept of arrays.
Link to the repl.it used today: https://replit.com/@offexe/9-18-2022#Main.java
Homework: Create a program that takes input that represents a student's grade, age, gpa, name, and school. What types of variables will you use for each? Then, print out all the information about that student in one line with whatever formatting you want.
Extra Challenge: Create an array from input of grades a student has in each of their classes, then calculate the gpa with 3 decimal points.
Please send your solutions in the comments below :)
Jerry's work
import java.util.Scanner; public class epiccode { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Please input a year you would like to find out if it was a leap year or not"); int year = input.nextInt(); if (year%4==0) { System.out.println("This year is a leap year"); } else { System.out.println("This is not a leap year"); } } }