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 java test program

Write a Java test program, all the code should be in a single main method that calculates and outputs the average of the numbers 1, 2, 9, 27, and 54.

  How does a marketer balance the short-term gains

How does a marketer balance the short-term gains that sales promotion can deliver against the possible negative long-term consequences such promotions might have for brands? Use appropriate examples.

  Prompts the user to input a decimal number

Write a program that prompts the user to input a decimal number and ouputs the number rounded to the nearest integer.

  Write down the java code for the bank

Write down the java code for the bank of Fraud. User is presented with menu which looks something like this: 1. Deposit 2. Withdrawal 3. Check Balance 4. Exit.

  Java program for presidential elections

Write a java program for Presidential Elections, the user will enter his votes based on the code for each candidate. The program will add the total votes for each candidate and proclaim the winner whoever got the most number of votes.

  The letters of the alphabet a through z

The letters of the alphabet A through Z can be represented in Morse code. Each letter is represented by a combination of up to four dots and/or dashes, as shown below. Use Java to write and run a console-window program that can convert an English ..

  We developed a stringlog adt it represents a log that holds

we developed a stringlog adt. it represents a log that holds objects of class string. suppose that instead of

  Implement savings account using locks and conditions

A savings account object holds a non-negative balance - Use a shared counter protected by test-and-test-and-set lock. Each thread locks the counter, increments it, releases the lock, and repeatedly reads the counter until it reaches n.

  Aims1 to understand actual communication with an smtp

aims1. to understand actual communication with an smtp server can be achieved using tcp sockets.2. to understand the

  Generate and manipulate music and images

Arrays are a fundamental and versatile tool for representing data of all shapes and sizes In this assignment, you'll see how arrays can be applied to generate and manipulate music and images.

  Create a class rectangle with attributes length and width

Create a class Rectangle with attributes length and width, each of which defaults to 1. Provide member function that calculate and the area of the rectangle.

  Create a method in your survey class called logresponse

Create a method in your Survey class called "logResponse()." This method should take three arguments. Implement the enhancements to your Survey class according to the requirements presented above.

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