Instructions
Name the Java Classes as specified below for each problem. Each problem requires only a single Class. The running of each of the programs should look very similar to the examples given below. (Formatting, etc. The numbers could differ each time the programs are run.)
Make sure you use a nice “class/file comment header block” at the beginning, as illustrated below. This should go at the very top of your .java file, before any of the code.
////////////////////////////////////////////////////////////
// Program: <put program name here>
// Author: <put your name here>
// Date: <put the date you wrote the program here>
// Description: <put a brief description of the program here>
// For: <put the course acronym+number here>
//////////////////////////////////////////////////////////// For example:
////////////////////////////////////////////////////////////
// Program: Interest
// Author: Sam Smith
// Date: 2019 Oct 27
// Description: Calculates and display simple interest
// when the principal and interest rate are entered.
// For: CIS210
////////////////////////////////////////////////////////////
Java HW Descriptions
Anyone know how to code this?
Interest.java
import java.util.Scanner;
public class Interest {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the principal amount: $");
double principal = Double.parseDouble(sc.nextLine().trim());
System.out.print("Enter the interest rate: ");
double interestRate =
Double.parseDouble(sc.nextLine().trim());
double interest = (principal * interestRate);
System.out.printf("\nPrincipal: $%,5.2f\n", principal);
System.out.printf("Interest Rate: %,5.2f\n", interestRate);
System.out.printf("Interest: $%,5.2f\n", interest);
}
}
OUTPUT :

***********************************************************************************************************************************
Utility.java
import java.util.Scanner;
public class UtilityBill {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int count = 0;
double sum = 0.0, avg;
while(count <= 12)
{
if(count == 12)
{
avg = (sum / (double)count);
System.out.println("\nCount = " + count + "\n"
+ "Sum = " + sum + "\n"
+ "Average = " + avg);
System.exit(0);
}
else
{
count++;
System.out.print("Enter the bill amount for month " + count + ":
$");
double bill = Double.parseDouble(sc.nextLine().trim());
sum += bill;
}
}
}
}
OUTPUT :

Instructions Name the Java Classes as specified below for each problem. Each problem requires only a...
You will write Java programs in Eclipse to solve these word problems Read these instructions on how to name and submit the Java files. Please make sure your program compiles before you submit it. Make sure you name your Java file and class the same (otherwise it will not compile). For example, the class names are case-sensitive 1. will be in a file called CompareNames.java; remember, the Do not create a package. You can tell if your file is in...
Homework description::::: Write JAVA program with following description. Sample output with code will be helful... A compiler must examine tokens in a program and decide whether they are reserved words in the Java language, or identifiers defined by the user. Design a program that reads a Java program and makes a list of all the identifiers along with the number of occurrences of each identifier in the source code. To do this, you should make use of a dictionary. The...
Java Programming: Make a Java program with two processes, a producer and a consumer. If you want to use another language, clear it with me first. The producer process consists of a loop that writes the loop count (a value from 0 to 4) into a variable that it shares with the consumer process (this variable is to be initialized to 100). On each pass through the loop, before the producer writes into the shared variable, it does a random...
THIS IS IN THE JAVA SCRIPT CODE
ALSO PLEASE SEND ME THE CODE TYPED THANK YOU.
Program 1 Write an inheritance hierarchy of three-dimensional shapes. Make a top-level shape interface that has methods for getting information such as the volume and the surface area of a three-dimensional shape. Then make classes and subclasses that implement various shapes such as cube, cylinders and spheres. Place common behavior in superclasses whenever possible, and use abstract classes as appropriate. Add methods to the...
What this Assignment Is About: Review on Java I topics, such as primitive data types, basic I/O, conditional and logical expressions, etc. Review on Java loops. Documentation Requirements to get full credits in Documentation The assignment number, your name, StudentID, Lecture number(time), and a class description need to be included at the top of each file/class. A description of each method is also needed. Some additional comments inside of methods (especially for a "main" method) to explain code that are...
In java netbean8.1 or 8.2 please. The class name is Stock. It has 5 private attributes (name, symbol, numberOfShares, currentPrice and boughtPrice)and one static private attribute (numberOfStocks). All attributes must be initialized (name and symbol to “No name/ symbol yet” and numberOfShares, currentPrice and boughtPrice to 0. Create two constructors, one with no arguments and the other with all the attributes. (However, remember to increase the numberOfStocks in both constructors. Write the necessary mutators and accessors (getters and setters) for...
Assignment on Java programing 1. Write programs for the following exercises in Java. Each file should have short description of the implemented class and for files with main method the problem it is solving. Make sure your files have appropriate names. Programs should write output to the Console. b) BST: Implement Binary Search Tree ADT with insert(int key), delete(int key), Node find(int key), and in-order traverse() where it prints the value of the key. Your operations should use recursion. The...
M01 PA C++ Classes and Objects INTRODUCTION: Write a C++ program that implements and utilizes a Stereo Receiver Class/Object. INCLUDE IN YOUR ASSIGNMENT At the top of each of your C++ programs, you should have at least four lines of documentation: Program name (the C++ file name(s)), Author (your name), Date last updated, and Purpose (a brief description of what the program accomplishes). Here is an example: // Program name: tictactoe.cpp // Author: Rainbow Dash // Date last updated: 5/26/2016...
You need to program a simple book library system. There are three java classes Book.java // book object class Library.java //library class A2.java //for testing The Book.java class represents book objects which contain the following fields title: a string which represents the book title. author: a string to hold the book author name year: book publication year isbn: a string of 10 numeric numbers. The book class will have also 3 constructors. -The default no argument constructor - A constructor...
Overview These exercises will allow you to have some practice with basic Java file Input/Output. In addition, you will also have an opportunity to have more practice with methods and arrays. Objectives Practice with programming fundamentals Variables - Declaration and Assignment Primitive types Arithmetic Expressions Simple keyboard input and text display output Branching - if-elseif-else syntax Loops - simple while loops, nested while loops Methods - functions and procedures ArrayLists - collections of variables File I/O Works towards the following...