Shares Investment and Adult BMI Calculator
SPRING COSC1437 – LAB2 TITLE Shares Investment and Adult BMI Calculator TIME TO COMPLETE Two weeks (16 weeks class) – 1 week ( short term class ) HOW TO DO EACH PART Do the lab with the following: STEP1: CREATE THE PSEUDO-CODE AND LEARN JAVA SYNTAX 1. Read the lab requirement then figuring out: -What does the requirement ask for? -Then, figure out and list step by step in English what do you need to do to come up the final solution (in a word document) that must be qualified to the requirement. This document is called the pseudo-code. 2. Learn the Java syntax to translate each English step in the pseudo-code to Java language (that means write the java code). If you need help on this step, read the topics relating to the action of each step in HOW TOT DO LAB to learn the java syntax. For example, the lab requirement asks you to display something on the screen, then you can read the topic “How to display output on the screen” in the HOW TO DO LAB. 3. When you are ready with java syntax that needs for the lab, you bring up the eclipse or other editor to start writing java program. STEP2: CREATE THE JAVA PROJECT AND WRITE THE JAVA CODE *From now and on yourLastName will be changed to your last name *Your program should change Martinez to your last name *Change LUIZ MARTINEZ to your full name *write the file name as the first comment line at the top of program. The java comment line starting with // as the comment line in java *After running your program successfully, take the picture of the output window and paste the picture at the bottom of the document having pseudo-code to turn in 1. Start editor eclipse, create the project → write the project name Project name of the Part 1: SP2024_LAB2PART1_yourLastName Project name of the Part 2: SP2024_LAB2PART2_yourLastName 2. Add the driver class that include the function main(). Class name will be the file name. Part1: the name of the driver class: SP2024_SharesInvestment_yourLastName Part2: the name of the driver class: SP2024_AdultBMI_Calculator_yourLastName An empty window is coming up that is ready for you to write java code 3. In the empty class, type the following template of a java program in: For example with the Part1 (yourLastName should be changed to your last name //File name: SP2024_SharesInvestment_yourLastName.java public class SP2024_SharesInvestment_yourLastName { public static void main(String[ ] args) { //add the code here below this line ….. } } STEP3: COMPILE THE CODE AND FIX THE ERRORS STEP4: RUN THE PROGRAM *With eclipse, the project will be automatically compiled, creates the object file .class then run to provide the output on the Console window if the code with no syntax errors. LAB2 PART1 REQUIREMENT Provide the pseudo-code and a java application to help Investors to calculate the profits after their investments. Through a broker, the Investors buy a number of shares then after a while they sale these shares when they see the share price is growing up. Frist, the application should declare variable, display message to ask the investors to enter their information from the keyboard about: * Investor name (String) * number of shares the investors want to invest (int) * purchase price of one share (float) * sale price of one share (float) The broker will charge commission fee rate 1.79% on the money of shares purchased and on the money of shares sold ==> Declare the commission fee rate as a constant final float COMMISSION_RATE = 1.79f; (This means the rate is 1.79%) The formula to calculate the profit from the investment as below: PURCHASE The money of shares purchased = purchase price of one share * number of shares Commission fee on purchasing = The money of shares purchased * commission rate Total of money paying on purchasing = The money of shares purchased + commission fee on purchasing SALE The money of shares sold = sell price of one share * number of shares Commission fee on selling = The money of shares sold * commission fee rate Total money getting from selling = The money of shares sold – commission fee on selling The profit from the investment = Total money getting from selling – Total of money paying on purchasing After calculating, the application must display the result on the screen with 11 output lines in the following format with the name and numbers should be aligned to the right and the number should be in 2 decimal digits. Notes: You must complete reading input before displaying the output and write the comments for each task (not for each line of the code) The output should include 13 lines in the following format: LAB2 PART2 REQUIREMENT Provide the pseudo-code and Java application to help users to calculate the BMI rate of Adults. BMI (Body Mass Index) is a measure of body fat based on height and weight of adult men or women. The application should display message to ask and read from the keyboard users to enter the users’ information from the keyboard about: *The name of user (string) *Height in inches (int) *Weight in pounds (int) The formula to calculate BMI: BMI = (weight * 703) / (height * height) The BMI rate result is a decimal number and displayed with 9 output lines in the following and BMI rate will be in 2 decimal digits. Notes: You must complete reading input before displaying the output and write the comments for each task (not for each line of the code) HOW TO TURN IN THE LAB ATTENTION: Compress each project folder into a file .zip or a file .rar. that includes source files and class files. -If you do not have the source file and file .class, your lab gets 0 points -If you do not provide file .class of the part, you only have half of the max score of the part You should turn in the following files: 1.Lab2_pseudoCode_yourLastName.docx (including Pseudo-code and the output pictures of both parts) 2.SP2024_LAB2PART1_yourLastName.zip (including file SP2024_SharesInvestment_yourLastName.java and file SP2024_SharesInvestment_yourLastName.class) 3.SP2024_LAB2PART2_yourLastName.zip (including file SP2024_AdultBMI_Calculator_yourLastName.java and file SP2024_AdultBMI_Calculator_yourLastName.class) HOW TO GRADE THE LAB ITEMS TURN IN THE LAB ON TIME Part 1: Name of project and source file correct, submit all requested files Part 1: pseudo-code and output pictures Part 1: Define variables, read input Part 1: calculate the result correctly Part 1: output separate from input Part 1: output 11 lines with correct alignment, numbers in 2 decimal digits Part 1: compile without errors, qualified the requirements Part 1: write comments, file name as comment at top Part 2: Name of project and source file correct, submit all requested files Part 2: pseudo-code and output pictures Part 2: Define string variable, read input Part 2: calculate BMI correctly Part 2: output separate from input Part 2: Display 11 lines in correct alignment, number in 2 decimal digits Part 2: write comments, file name as comment at top Part 2: compile success – qualify the requirement – code indented easy to read Total lab2 scores POINT 3 1 2 1 3 1 2 3 1 1 2 1 1 2 2 1 3 30
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
