Question

NOTE: The blue marker is blocking a name. I need to replace with my own. So just put "yourlastname" as a substitution!

PART1-Requirement Create a project named SP2019_LAB2PAR1 Add the source file name Sharelnvestment yourLastName.java and displPART2 - Requirement Create a project named SP2019 LAB1PART2_LastName Add the source file name AdultBMI_Calculator yourLastNam

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hello, here is the completed code you wanted. Every important statement is explained using comments. Please check and let me know if you have any doubts. Thanks.

PART 1

PSEUDOCODE

BEGIN
   Declare name as String;
   Declare shares as int;
   Declare price, percentage,total_invested,total_returned as double;
  
   Read name,shares,price,percentage;
  
   Set total_invested=price*shares;
   Set total_returned=total_invested+total_invested*percentage;
  
   Print name;
   Print shares;
   Print price;
   Print percentage;
  
   Print total_returned  
END;

CODE

//ShareInvestment_yourLastName.java
import java.util.Scanner;

public class ShareInvestment_yourLastName
{
   public static void main(String args[])
   {
       //variables
       String name;
       int shares;
       double price,percentage;
       double total_invested,total_returned;
      
       Scanner sc=new Scanner(System.in);
      
       //prompt for name
       System.out.printf("Enter your name: ");
       name=sc.nextLine();
      
       //prompt for number of shares
       System.out.printf("Enter number of shares: ");
       shares=Integer.parseInt(sc.next());
      
       //prompt for price of each share
       System.out.printf("Enter price for each share: ");
       price=Double.parseDouble(sc.next());
      
       //prompt for percentage of yearly dividend
       System.out.printf("Enter percentage of yearly dividend: ");
       percentage=Double.parseDouble(sc.next());
      
       //calculating total invested
       total_invested=price*shares;
      
       //calculating total returned
       total_returned=total_invested+(total_invested*(percentage/100));
              
       //printing outputs
       System.out.println("INVESTMENT CALCULATOR - yourlastname");
       System.out.println("-------------------------------------------------");
      
       System.out.printf("Name of investor:                   %s\n",name);
       System.out.printf("Number of shares:                   %d\n",shares);
       System.out.printf("Price of each share:                %.2f\n",price);
       System.out.printf("Percentage yearly dividend:         %.2f%%\n",percentage);
      
       System.out.println("-------------------------------------------------");
      
       System.out.printf("Total money at the end of the year: %.2f\n",total_returned);
   }
}

OUTPUT

tnentyourLat Nane C:NUser SAW Downloads>java ShareInvest Enter your name James Smith Enter number of shares 1200 Enter price

CODE SCREEN SHOT

ShareInves tment yourLastName java import java.util.Scanner; public class ShareInvestment yourLastName public static void mai37 38 39 40 41 42 //printing outputs System.out.println(INVESTMENT CALCULATOR yourlastname System.out.println( System.out.

PART 2

PSEUDOCODE

BEGIN
   Declare name as String;
   Declare height,weight,bmi as double;
  
   Read name,height,weight;
  
   Set bmi = (weight*703)/(height*height);
  
   Print name;
   Print height;
   Print weight;
   Print bmi;
END;

CODE

//AdultBMI_Calculator_yourLastName.java
import java.util.Scanner;

public class AdultBMI_Calculator_yourLastName
{
   public static void main(String args[])
   {
       //variables
       String name;
       double height,weight,bmi;
      
       Scanner sc=new Scanner(System.in);
      
       //prompt for name
       System.out.printf("Enter your name: ");
       name=sc.nextLine();
      
       //prompt for height
       System.out.printf("Enter Height: ");
       height=Double.parseDouble(sc.next());
      
       //prompt for height
       System.out.printf("Enter Weight: ");
       weight=Double.parseDouble(sc.next());
      
       //calculating bmi
       bmi=(weight*703)/(height*height);
      
      
       //printing outputs
       System.out.println("BMI CALCULATOR - yourlastname");
       System.out.println("-------------------------------------------------");
      
       System.out.printf("Name:                  %s\n",name);
       System.out.printf("Height:                %.2f\n",height);
       System.out.printf("Weight:                %.2f\n",weight);
       System.out.printf("BMI:                   %.2f\n",bmi);
      
       System.out.println("-------------------------------------------------");
   }
}

OUTPUT

CUsers SAVNDownloads>jaa AdultBMI _Calculator yourLastName Enter your name James Smith Enter Height: 58 Enter Weight: 104 BMI

CODE SCREEN SHOT

/AdultBMI_Calculator_yourLastName.java import java.util.Scanner public class AdultBMI_Calculator yourLastName public static v37 38 39 40 41 L System.out.printf (BMI: 동.2f\n , bmi) ; System.out.println(

Add a comment
Know the answer?
Add Answer to:
NOTE: The blue marker is blocking a name. I need to replace with my own. So...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • LAB1 PART 1 FOR THE DATA TYPE CLASS: If you do not have UML of class...

    LAB1 PART 1 FOR THE DATA TYPE CLASS: If you do not have UML of class Account_yourLastName, you should do that first Basesd on the UML, provide the code of data type class Account_yourLastName to hold the information of an account with account number (String), name (String), balance (double), with no-argument constructor, parameter constructor Also, define some methods to handle the tasks: open account, check current balance, deposit, withdraw, and print monthly statement. At the end of each task we...

  • I need this in Net beans and not Python. Part 1 - Pseudo-code Design and write...

    I need this in Net beans and not Python. Part 1 - Pseudo-code Design and write the pseudo-code for the following Problem Statement. Problem Statement A company gives its employees an that will provide one of 3 results based on the following ranges of scores: Score Message on Report 90-100 Special Commendation 70-89 Pass Below 70 Fail Design a single If-Then-Else structure using pseudo-code which displays one of these messages based a score input by a user. Be sure your...

  • I need Notebook++ coding! Thanks so much I will upvote! <!DOCTYPE html> <html> <body> <!-- replace...

    I need Notebook++ coding! Thanks so much I will upvote! <!DOCTYPE html> <html> <body> <!-- replace the text below with your name!-->    <!-- -->    <!-- -->    <title> Jason Kidwell</title> <script> // // Scientists measure an object’s mass in kilograms and its weight in newtons. // If you know the amount of mass of an object in kilograms, you can calculate // its weight in newtons with the following formula: // //       weight=mass×9.8 // // Write a...

  • Write a program in java. You are tasked with writing an application that will keep track...

    Write a program in java. You are tasked with writing an application that will keep track of Insurance Policies. Create a Policy class called InsurancePolicies.java that will model an insurance policy for a single person. Use the following guidelines to create the Policy class: • An insurance policy has the following attributes: o Policy Number o Provider Name o Policyholder’s First Name o Policyholder’s Last Name o Policyholder’s Age o Policyholder’s Smoking Status (will be “smoker” or “non-smoker”) o Policyholder’s...

  • I need help with my C coding homework. If possible can you please comment to help...

    I need help with my C coding homework. If possible can you please comment to help me understand whats going on in the code. Thanks in advance. Create a C program (3 points): o At the top of the file include the following comments: Your name The purpose (core concept found below) of the program The date created o Create two int variables: Initialize each to different values. o Create three pointers: Point the first two pointers to the first...

  • guys can you please help me to to write a pseudo code for this program and...

    guys can you please help me to to write a pseudo code for this program and write the code of the program in visual studio in.cpp. compile the program and run and take screenshot of the output and upload it. please help is really appreciated. UTF-8"CPP Instruction SU2019 LA X 119SU-COSC-1436- C Get Homework Help With Che X Facebook -1.amazonaws.com/blackboard.learn.xythos.prod/584b1d8497c84/98796290? response-content-dis 100% School of Engineering and Technology COSC1436-LAB1 Note: in the instruction of the lab change "yourLastName" to your last...

  • I need help with my homework assignment Linux systems keep user account information in the passwd...

    I need help with my homework assignment Linux systems keep user account information in the passwd file and the encrypted password in the shadow file. The passwd file containing account information might look like this: smithj:x:1001:1001:John Smith:/home/smithj:/bin/bash The shadow file containing password and account expiration information for users might look like this: smithj:KJDKKkkLLjjwlnttqoiybnm.:10063:0:99999:7::: The fields in the shadow file are separated by a colon, with the first field being the username and the second being the password. Under normal circumstances,...

  • I need help in Python. This is a two step problem So I have the code...

    I need help in Python. This is a two step problem So I have the code down, but I am missing some requirements that I am stuck on. Also, I need help verifying the problem is correct.:) 7. Random Number File Writer Write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 500. The application should let the user specify how many random numbers the file...

  • Hello I need help fixing my C++ code. I need to display in the console the...

    Hello I need help fixing my C++ code. I need to display in the console the information saved in the file as well have the content saved in the file output in a fixed position like the screenshot. Thanks. CODE #include<iostream> #include<fstream> #include<iomanip> using namespace std; //main function int main() {    //variable to store student id    int id;       //variables to store old gpa(ogpa), old course credits(occ), new course credits(ncc), current gpa(cur_gpa), cumulative gpa(cum_gpa)    float ogpa,...

  • Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and...

    Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and please add comments for the whole code. Include a class diagrams, and explain the approach you used for the project and how you implemented that, briefly in a few sentences. Please note the following: -Names chosen for classes, functions, and variables should effectively convey the purpose and meaning of the named entity. - Code duplication should be avoided by factoring out common code into...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT