Question
Any one cane Help me to Check my Project according to the attached document. My Java project is: /** * * Application/Program description * *
Any one cane Help me to Check my Project according to the attached document.
My Java project is:
/** * * Application/Program description * * @author xxxxxxx * @version 1.0 * @since 2021-02-06 */ //============================================ //******************************************** import java.util.*;
public class Main { public static void main(String[] args) {
System.out.println("Enter the amount"); try (Scanner sc = new Scanner(System.in)) { // this makes 47.63 into 4763 int amt = (int) Math.round(sc.nextDouble() * 100);
// to calculate ten dollar bills int ten_dollars = amt / 1000;
// to get amount after excluding ten dollars bills amt = amt % 1000;
// to calculate five dollar bills int five_dollars = amt / 500;
// to get amount after excluding five and ten dollars bills amt = amt % 500;
// to calculate one dollar bills int one_dollars = amt / 100;
// to get amount after excluding ten,five,one dollars bills amt = amt % 100;
// to calculate quarters int quarters = amt / 25;
// to get amount after excluding ten,five,one dollars bills,quarters amt = amt % 25;
// to calculate dimes int dimes = amt / 10;
/* * to get amount after excluding ten,five,one dollars * bills,quarters,dimes */ amt = amt % 10;
// to calculate nickels int nickels = amt / 5;
// to get amount after excluding ten,five,one dollars // bills,quarters,dimes,nickels amt = amt % 10;
// to calculate pennies int pennies = amt / 1;
System.out.println(ten_dollars + " ten dollar bills"); System.out.println(five_dollars + " five dollar bills"); System.out.println(one_dollars + " one dollar bills"); System.out.println(quarters + " quarters "); System.out.println(dimes + " dimes"); System.out.println(nickels + " nickels"); System.out.println(pennies + " pennies"); }
}
}
Style Guidelines Design Guidelines 1-1 Use meaningful names for identifiers, lsut keep them reasonably short Use TitleCasing for class names Use LamelBackCasing tur variables and incthod namics Use CATITAL_LETTERS with morils scptatel Lytuurscore for constants 1-1 Indont the code in any black by 3-4 spaces (lx consistent) Pul the Icl curly brace I starting cach block or code on a new lineal he same indention level is the block loader Pullhe matching righl curly have } lined up under its associated opening brace 1-1 Put one space alter each comma in a parameler list l'ut one space on each side of a binary operator TX NOI put spaces immediately after a left parenthesis or before a right parenthesis .IX NOT put spucs for a semicolon Puluw Spice before le pruunsis (tuuless it is for a comply puuter list) . Think belore you start coding Lise only one return statement per method and it should be the last slalement in the method - Do not have additional methods in the class that contains the main method 2 If only one class is used from an imported package, import that class by specific name (not *) Do not declare class level variables with public visibility 1 Use constants instead of literals If a variable is used as a constant value, declare it using final . Extend logical lines of code over two or more lines ONLY when necessary Style Guidelines Design Guidelines 1-1 Use meaningful names for identifiers, lsut keep them reasonably short Use TitleCasing for class names Use LamelBackCasing tur variables and incthod namics Use CATITAL_LETTERS with morils scptatel Lytuurscore for constants 1-1 Indont the code in any black by 3-4 spaces (lx consistent) Pul the Icl curly brace I starting cach block or code on a new lineal he same indention level is the block loader Pullhe matching righl curly have } lined up under its associated opening brace 1-1 Put one space alter each comma in a parameler list l'ut one space on each side of a binary operator TX NOI put spaces immediately after a left parenthesis or before a right parenthesis .IX NOT put spucs for a semicolon Puluw Spice before le pruunsis (tuuless it is for a comply puuter list) . Think belore you start coding Lise only one return statement per method and it should be the last slalement in the method - Do not have additional methods in the class that contains the main method 2 If only one class is used from an imported package, import that class by specific name (not *) Do not declare class level variables with public visibility 1 Use constants instead of literals If a variable is used as a constant value, declare it using final . Extend logical lines of code over two or more lines ONLY when necessary
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started