ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 24 May 2017 My Price 9.00

Variables to hold values

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);

Answers

(11)
Status NEW Posted 24 May 2017 03:05 AM My Price 9.00

-----------

Attachments

file 1495596323-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)