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

  Define multi-threaded programming in java using locks

Define Multi-threaded Programming in Java Using Locks, To practice programming cooperating, synchronized multiple threads of execution

  Create a gui application with jframe

Place a JButton on the JFrame, and code its functionality so that every time the user clicks on the button one of the reasons is removed from a label.

  Write a reference class called ctatrain

writing a reference class that consist of the 2nd and 3rd instance variables below. my class should consist of an array of values in the 2nd instance variable

  Compare and determine the smallest number

The main method that begins execution of Java application

  Prepare an application that creates object of the classes

Write a CarbonFootPrint with only a pure virtual getCarbonFootprint method -  Have each of your classes inherit from the abstract class and implement the getCarbonFootprint method to compute an appropriate carbon footprint for that class.

  Application that will allow a new customer to order a house

Create an application that will allow a new customer to order a house. You'll allow the customer to choose among four models (Aspen, Britattany, Colonial, and Dartmoor) by creating separate ButtonGroups.

  What are differences between trusted and untrusted applets

What are the differences between trusted and untrusted applets? Why doesn't an applet viewed through the browser respond to keyboard events, but the same works fine from within appletviewer?

  Development of a graphical user interface

To understand actual communication with an SMTP server can be achieved using TCP Sockets and understand the development of a graphical user interface (GUI) and use of event handling.

  Discuss the pros and cons of compilers and interpreter

Pick a problematic situation that you think a Java program can solve or make easier.

  Java program to print strings given at command line

Write down program Average.java to print strings which it is given at command line, one per line. If nothing is given at command line, then print "No arguments".

  Write a program to generate a data file named wi ndl. dat

Write a program to generate a data file named wi ndl. dat

  Eclipse or netbeans environments

As recommendation, you can try to use Eclipse or NetBeans environments that are used also for other courses as: Introduction in Java programming and Intermediate programming.

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