Please tell me whats wrong with my code

Assignment Help Basic Computer Science
Reference no: EM131803722

Please tell me whats wrong with my code

import java.util.Scanner; //will allow you to read from the screen

public class GradesArray {

public static void main (String[]args) {

String[] nameArray = {"Jon", "Rajesh", "Elizabeth", "Julio", "Chang"};

String[] gradeArray = new String[5]

double[] score1Array = {72, 60. 45, 70, 89};

double[] score2Array = {50, 70, 60, 85. 90};

double[] score3Array = {70, 80, 90, 100, 100};

double[] averageArray = new double[5];

for(int i=0; i<4; i++){ //why 4?

       averageArray[i] = (score1Array[i] + score2Array[i] + score3Array[i])/3;

    if (averageArray[i] > 90.0){

     gradeArray[i] = "A";

    } else if (averageArray[i] > 80.0){

     gradeArray[i] = "B";

    } else if (averageArray[i] > 70.0){

     gradeArray[i] = "C";

    } else if (averageArray[i] > 60){

     gradeArray[i] = "D";

    } else{

     gradeArray[i] = "F";

    }

    System.out.println("Name is: " + nameArray[i] + " Grade is: " + gradeArray[i] + " Average is: " + nameArray[i]);

}

}

}

//end main method

Reference no: EM131803722

Questions Cloud

Paragraph describe the importance of vba : What is VBA? Why do we need VBA, in two lengthy paragraph describe the importance of VBA
Explaining the different roles in the buying process : Family members play many different roles in the buying process: initiator, influencer, decision maker, purchaser, and consumer.
Write about recruitment and selection : Write about Recruitment and Selection - Introduction should talk about the subject and different topics that come under it. Word count shouldn't exceed 100-120
Which three do you think you will have difficulty with : This Question is from Student Preperation for Distant Leaning. Which characteristics would you rank as the top three being most important and why?
Please tell me whats wrong with my code : Please tell me whats wrong with my code
What challenges are shaping today global industry : Over the course of the week, they discussed where we've been, where we're going and what trends, challenges and opportunities are shaping today global industry
What is the difference between an optical mouse : What is the difference between an optical mouse, wireless mouse, and an air mouse?
Explain the mission of us government accountability office : Why is an audit considered to be the final phase of a budgetary process? Explain the mission of the U.S. Government Accountability Office.
How long does each type of customer spend in the store : How long does each type of customer spend in the store? How long does the average customer spend in this store?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd