Find the errors in the java code

Assignment Help JAVA Programming
Reference no: EM13940980

1. What are the errors in the following codes: What would correct the errors?

A.) if ( age >= 65 ) ;
System.out.println( "Age greater than or equal to 65" );

else

System.out.println( "Age is less than 65 )";

B.) int x = 1, total;
while ( x <= 10 )
{

Total += x;
++x;

}

C.) while ( x <= 100 )
total += x;

++x;

D.) while ( y > 0 )
{

System.out.println( y );
++y;

_________________________________________________________________________

2. Drivers are concerned with the mileage their automobiles get. One of my drivers has kept track of several tankfuls of the gas he used and recorded the miles driven and gallons used for each tankful. I need help developing a JAVA application that will input the miles driven and gallons used(both as integers) for each thankful. The program should calculate and display the miles per gallon obtained for each thankful and print the combined miles per gallon obtained for all tankfuls up to this point. All averaging calculations should produce floating-point results. Use class Scanner and sentinel-controlled repetition to obtain the data from the user.
__________________________________________________________________________

3.) A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus %9 of their gross sales for that week. An example of this would be "a salesperson who sells $5000 worth of merchandise in a week receives $200 plus %9 of $5000 or a total of $650. I have been supplied with a list of the items sold by each salesperson. The value of these items are listed below:

Item Value
1 239.99
2 129.75
3 99.95
4 350.89

I need help developing a Java application that inputs one salesperson's items sold for last week and calculates and displays that salesperson's earnings. There is no limit to the number of items that can be sold by a salesperson.

Reference no: EM13940980

Questions Cloud

Prepare the entry to recognize the first interest payment : Prepare the entry to recognize the sale of the bonds on December 31, 2009. Prepare the entry to recognize the first interest payment on June 30, 2010.
Key forces for organisational change : Identify the key forces for organisational change (both internal and external) at Lion Nathan/ Lion. Draw on Kotter's eight-step plan for implementing change to analyse the change process that has been implemented at Lion Nathan and Lion. Evaluate..
Identify possible sources of energy : Produce a design specification which includes at least 10 requirements and constraints and produce a design solution in the form of a concept sketch with an accompanying explanation
Emerging trends in organisational behaviour : The changing workforce is one of the emerging trends in organisational behaviour. Describe how the workforce is changing and briefly identify two consequences of these changes for organisations.
Find the errors in the java code : What are the errors in the following codes: What would correct the errors?
What factors influence an adolescent maturity : Should there be an across-the-board age limit that defines the border between the juvenile and adult criminal justice systems? Or should it vary on a case-by-case basis? Explain your reasoning.
Problem regarding the knowledge and analytical skills : In this assignment you should demonstrate how well you can apply the knowledge and analytical skills. Choosing the right case is also important. The organisation you choose should be one you are interested in and one for which sufficient data/infor..
Discuss the various logistical issues : Discuss the various logistical issues you would have to consider before commencing the import of products from the two new factories, taking into account the various procedures that need to be considered,
Search for organisations interested in its purchase : M J Morris is a prosperous unquoted company, whose owners are also the directors. The directors have decided to sell their business, and have begun a search for organisations interested in its purchase. They have asked for your assessment of the p..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Difference for class linked bag and test into main program

write a method difference for the class linked bag and test into main program.

  Creating a grade book that will use arrays

You will be creating a grade book that will use arrays to store students and their grades. The breakdown of the project is as follows. You must be able to add a student, remove a student, edit a student, remove all students, and exit the program

  Compare the complexity based on the running time

Write a driver java program, based on the provided source code, to rum those 4 algorithms for the Maximum Subsequence Sum problem and compare the complexity based on the running time.

  Create a class called bankaccount

For your new program (#5 above), create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance. The BankAccount class should have two constructors, as follows:

  Write a program that displays a countdown first

Write a program that displays a countdown first, and then displays the position and velocity of an object for every second it drops, as long as it is above 500 feet

  Splash page designed for an app called super foods

Splash page designed for an app called Super Foods. Attached is the skeleton app

  Java test program

Write a Java test program, all your code should be in the main method, that determines what type of organization is indicated by a web address. Your program should allow the user to enter a web address

  Uml exercise

UML Exercise: Automated Teller Machine (ATM),   1. To allow authorized card holders to make transactions,   Brief Summary of Requirements:

  Create a splash screen for the tgc application

To complete your splash screen please use the information below: Create a splash screen for the TGC application that displays: the application's name.

  Create a japplet that contains a jlabel and jbutton

Create a JApplet that contains a JLabel and JButton -  create an HTML document to host the applet, set the Width to 450 and the Height to 200. Save as TestJChangeFont.html.

  Write a program that shows the current time and date

Write a program that shows the current time and date

  Use java

How to use Java.

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