The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Hello so I wrote this code for a homework assignment. Ive tried compiling it and it says I have 3 errors. 2 on line 51 and 1 on line 55. Can you please help me identify what these 3 errors are and how they can be fixed please ? Thank you so much ! I have pasted the code below.
Â
public class Homework1 {
public static void main(String[] args) {
// Variables to hold values
byte year = 0;
int month = 0;
float latitude = 0.0f;
float longitude = 0.0f;
System.out.println("Welcome to My Very Own Survey");Â
// Use the Scanner class to input data from Standard I/O
Scanner scannerIn = new Scanner(System.in);
// Prompt the user to enter their Birth Year
System.out.println("Please enter your Birth Year (1900-2014):");
year = scannerIn.nextByte();
// Verify the Birth Year
System.out.println("The following Year was entered " + year);
//Prompt the user to enter their Birth Month
System.out.println("Please enter your Birth month (1-12):");
// the nextInt() method scans the next int value
month = scannerIn.nextInt();
// Verify the Birth month was entered
System.out.println("The following month was entered " + month);
//Prompt the user to enter their day of Birth
System.out.println("Please enter your birth DATE (1-31):");
// the nextInt() method scans the next int value
month = scannerIn.nextInt();
// Prompt the user to enter the latitude of their address
System.out.println("Please enter the latitude of your address:");
latitude = scannerIn.nextFloat();
// Prompt the user to enter the longitude of their address
System.out.println("Please enter the longitude of your address:");
longitude = scannerIn.nextFloat();
// Prompt the User to enter their current GPA
System.out.println("Enter your current GPA (0.0-4.0):");
// Display all results to Standard Output
System.out.println("***Thank you for completing my survey***");
System.out.println("You have entered the following data:");
System.out.println("Birth Year is:" + Year);
System.out.println("Birth month is :" + Birth month);
System.out.println("Birth Day is :" + day);
System.out.println("latitude is :" + latitude);
System.out.println("longitude is :" + longitude);
System.out.println("GPA is :" + GPA);
-----------