Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Java programs tend to have three types of errors: javac compiler errors, syntax errors, or logic errors. Javac errors are usually related to misspelled commands, filenames, or improper installation of Java, whereas syntax errors are generated by the compiler. When you compile a program, sometimes one syntax error may generate multiple error messages and sometimes multiple syntax errors may generate only one error message. Programs with logic errors will compile cleanly but will not provide the correct output for a given input. These logic errors are often more difficult to find and fix than syntax errors.

In programming, there are many strategies available for solving such errors or problems. The five-step approach is one of the most common. These five steps include:

Specify the problem-identify the problem as specifically as possible. Be sure to include details of what you want to accomplish (the goal state).

Analyze the problem-learn as much as you can about the problem. Some techniques that can be used in this step include brainstorming, research, and talking to other people about the problem.

Develop a set of possible solutions-usually there is more than one way to solve a problem. Using the same techniques as in Step 2, think of possible solutions. It often helps to consider how you solved similar problems in the past.

Evaluate possible solutions-weigh the strengths and limitations of each solution you discovered in Step 3.

Choose a solution-consider several factors such as time required, financial cost, practicality, and so forth.

When you write a Java program in this course, you typically start with a template that you have copied and pasted from a previous program into your Java editor. You then modify this template to create the code you need. Usually, the code will start with some information that is input into the program (via user keyboard input for simple programs or later by reading a data file). The program then processes the information and creates output (once again, simple programs send output to the screen, more complex programs may send output to the file and error messages or confirmation messages to the screen).
For this Discussion:

Assume you have written a Java program that takes four input variables (integerOne, integerTwo, integerThree, integerFour) and calculates an output variable (resultOut) using the following formula: resultOut = (integerOne + integerTwo) * integerThree - integerFour .

Using your text and/or the Internet as a resource, list three different types of syntax errors the Java compiler may find in your program. Then, use the five problem-solving steps listed above to determine how you will fix each type of error. Be sure to clearly highlight the five steps within your posting.

Finally, assume your program compiles cleanly with no syntax errors. You input the values 2, 3, 4, 5 and the valueOut is computed to be 17 (it should be 15). Specify how you will use the five problem-solving steps to find the logic error.

Java, Programming

  • Category:- Java
  • Reference No.:- M92396092
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Java

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As