What would you do to make code execute

Assignment Help JAVA Programming
Reference no: EM131221133

Code Review

Can some have this done immediately

public class BankAccount
{
private double balance;

public BankAccount()
{
balance = 0;
}
public BankAccount(double initialBalance)
{
balance = initialBalance;
}
public void deposit(double amount)
{
balance = balance + amount;
}
public void withdraw(double amount)
{
balance = balance - amount;
}
public double getBalance()
{
return balance;
}
}

Look at the code above, and identify the following:

• Constructor
• Field
• Method
• Primitive Type
• Instance Variable

The class above is not a complete Java program that could execute. What would you do to make it execute? Change the program, or add a source code file, to make it into a Java program that executes.

Suggest two other improvements you would make to this code.

Reference no: EM131221133

Questions Cloud

How do they use their literary standpoints to affect us : Compare the motives for killing for Grenouille and Frankenstein's monster? Both use high culture topics of quest, genre, and archetypes to help us understand this idea--how do they use their literary standpoints to affect us? What is the moral pur..
Challenges of testing throughout software development : Business Value and Challenges of Testing throughout Software development Life Cycle: A case from Sudan Software Market - relationship between testing and application performance.
What is the company total assets turnover : Du Pont Analysis - Gardial& Son has an ROA of 12%, a 3% profit margin, and a return on equity equal to 13%. What is the company's total assets turnover
What are the central theses of the texts at hand : What are the central theses of the texts at hand? What is the main idea of the passage? Note key terms or issues. What quote(s) from the reading capture(s) the main idea?
What would you do to make code execute : The class above is not a complete Java program that could execute. What would you do to make it execute? Change the program, or add a source code file, to make it into a Java program that executes.
Find out the cube roots of a perfect cube : How to find out the cube root of perfect cubes within seconds. To find out the cube roots of a perfect cube, Find out the cube root of 19683. Find out the cube root of 250047 Find the cube root of 175616.
Develop the state table for given circuit : What kind of finite state machine is this: Using a procedure by inspection can you state which sequences does this circuit detect? (current bit goes last) Develop the State Table for this circuit. Label all columns
Identify one strategy that could be challenging : Self-reflection is a vital part of using positive guidance strategies with young children. Analyze the strategies presented in Chapter 5 and consider which you would feel comfortable using with young children and which may be more difficult for yo..
Does crc detect more errors than a parity bit : Does CRC detect more errors than a parity bit? Why or Why not? A world wide web server typically receives small messages from clients but sends very large messages back to them. What type of ARQ protocol would be best suited?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a class called misc that has no instance variables

Write a static double method called evaluateQuadraticPolynomial that takes four double parametersa, b, c, and x and returns the value of ax^2 + bx + c

  Write a recursive program

Write a recursive program to compute the number of ways in which an integer k can be written as sum

  Encrypt and decrypt the message using caesar cipher

Encrypt and decrypt the message using Caesar cipher

  Implements the queue interface

Element from an ArrayList is slow because of all the shifting. For this question, you should modify the poll()method so that it runs in constant time - implementations as well as correct/fast implementations. In the former case, your functions may..

  Create a class named blooddata

Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor

  Reading in strings from a text file into an array

If I am reading in strings from a text file into an array, where do I place this file at so that CodeBlocks will find it?

  Create set methods for color and height, but not for price

Create a class for the business named Candle that contains data fields for color, height, and price. Create get methods for all three fields

  Task 1university grading system maintains number of tables

task 1university grading system maintains number of tables to store retrieve and manipulate student marks. these tables

  Price and quantity of an article

XYZ Supermarket wants a program that will prompt for the product code, pricing code, price and quantity of an article. Your program is then to calculate a discount rate according to the pricing code.

  Write a recursive instance method

Write a recursive instance method

  Write a java that reads from the user annual income

Write a Java program (name it IncomeTax) that reads from the user annual income as  integer value.

  Rogram that will accept input and then display values

The program should continue as long as the user enters any values, even if only spaces are entered. Figure 9-49 (attached to post) displays sample output from the program.

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