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

  Do you agree or disagree with this statement

Planning is a useless endeavor because developments in e-business and e-commerce and in the political, economic, and societal environments are moving too.

  Write the equation of the parabola

Consider the equation 2y2 + 16y + 16x + 64 = 0. Identify the coordinates of the vertex and focus and the equations of the directrix and axis of symmetry. Then graph the equation.

  Day of searching and checking public ashtrays

After one whole day of searching and checking public ashtrays the begger finds a total of 72 cigarette butts. How many cigarettes can he make and smoke from the butts he found?

  Find the distribution of x the number of stages of service

Find the distribution of X, the number of stages of service left in the system

  Write a recursive function named print range

Write a recursive function named small count that, given the pointer to the root of a BST and a key K, returns the number of nodes having key values less than or equal to K. Function small count should visit as few nodes in the BST as possible.

  Six steps you should follow when creating an oo application

Describe the six steps you should follow when creating an OO application. Why do you think it is important to complete the steps in the proper order? What results when they are not in the proper order? After your initial post, be sure respond to a..

  Deployment services and the windows automated installation

For a highly virtualized data center, how does this change the deployment options available from traditional data centers? Is there any benefit or need in using some of the traditional deployment options (e.g., disk imaging using software like Gho..

  What is the variance of p

What is the variance of Pˆ2 for the two-sided test (assuming that p is not close to 0.5, where p is the true one-sided P-value?)

  Use two arrays of integers to store two test scores

You must use 2 arrays of integers to store the 2 test scores for each student. You must use a third array to store the average and a fourth array to store the letter grade.

  What are the arguments for and against brainstorming

What are the arguments for and against brainstorming? If you were Joseph Keith, would you vote for or against the continuation of the brainstorming sessions?

  Central computer at the same time

What is required when more than one persons use a central computer at the same time?

  Establish a software process that provides flexibility

Since tradeoffs are inherent to software engineering, make them explicit and document them.

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