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

  Find the rate of heat loss from the steam

Steam flows steadily through a turbine at a rate of 45,000 lbm/h, entering at 1000 psia and 9008F and leaving at 5 psia as saturated vapor. If the power generated by the turbine is 4 MW, determine the rate of heat loss from the steam

  The number of occurrences of each status using the count

Write a SQL expression to display each Status and the number of occurrences of each status using the Count(*) function; display the result of the Count(*) function as CountStatus. Group by Status and display the results in descending order of CountSt..

  Compute an iceberg cube for the dimensions

Suppose that we want to compute an iceberg cube for the dimensions, A, B, C, D, where we wish to materialize all cells that satisfy a minimum support count of at least v, and where cardinality(A)

  Comparing the number of emails that they received on a given

Katie, Charlie, and Tom are comparing the number of emails that they received on a given day. Charlie received 4 more emails than Katie,Tom received 5 times as many emails as Charlie. and the total number of emails between the three of them was 59..

  Main features of principled negotiation

What are the main features of principled negotiation? In the context of international business negotiation, what are the strengths and weaknesses of this approach?

  Check that function is not relying on any global variable

Use the find Globals () function available in code tools to check that the function is not relying on any global variables.

  News website for australian broadcasting corporation

Provide an expert review of the news website for Australian Broadcasting Corporation

  Addition to sorting and filtering cells by content

In addition to sorting and filtering cells by content, you can sort and/or filter by _____.

  What is the eirp in the direction of maximum antenna gain

A transmitter has an output power of 50 W. It is connected to its antenna by a feedline that is 25 meters long and properly matched. The loss in the feedline is 5 dB/100 m. The antenna has a gain of 8.5 dBi.

  Write a script that creates and calls a stored function name

2 . Write a script that creates and calls a stored function named discount_price that calculates the discount price of an item in the Order_Items table (discount amount subtracted from item price). To do that, this function should accept one paramete..

  Compare these speeds with those of the sorts

Modify the shellSort.java (Listing 7.1) and the quickSort3.java (Listing 7.5) programs to sort appropriately large arrays, and compare their speeds. Also, compare these speeds with those of the sorts in Chapter 3.

  Odd entries and the even entries

Stop reading numbers when the input value is zero. Display the total of the odd entries and the even entries.

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