Difference: CSC121S2024Lab01 (2 vs. 3)

Revision 32024-05-31 - CathyBareiss

Line: 1 to 1
 
META TOPICPARENT name="CSC121SylS2024"

First Program: Fall 2024

Learning Objective(s)

Line: 13 to 13
 For this part it is ESSENTIAL that you ONLY use your betheluniversity.edu account! Any other account (including a google account) will cause major problems!
  1. Follow the instructions to create your virtual machine.
    1. Step one is to redeem the coupon. Be EXTREMELY careful about how you are logged in with your browser!
Changed:
<
<
    1. Create a project in the csc121sp2024 folder using your name. For me, I might choose cathybareiss
>
>
    1. Create a project in the csc121fa2024 folder using your name. For me, I might choose cathybareiss
 
    1. invoke the shell
    2. enter: gcloud config set project {your project id (not name)}. For me, that would be cathybareiss
       gcloud config set project cathybareiss
Changed:
<
<
    1. enter the following (the {YOUR INSTANCE NAME} should be the name you want for the machine such as: BareissProg1
       gcloud compute instances create {YOUR INSTANCE NAME} --image-project csc121f2023sample --image csc121f2023sample --machine-type e2-small
      my example would be:
       gcloud compute instances create BareissProg1 --image-project csc121f2023sample --image csc121f2023sample --machine-type e2-small

      You might want to choose a different zone (esp. if you are having problems.)
>
>
    1. enter the following (the {YOUR INSTANCE NAME} should be the name you want for the machine such as: BareissProg1
       gcloud compute instances create {YOUR INSTANCE NAME} --image-project csc121f2023sample --image csc121f2023sample --machine-type e2-small
      my example would be:
       gcloud compute instances create BareissProg1 --image-project csc121f2023sample --image csc121f2023sample --machine-type e2-small

      You might want to choose a different zone (esp. if you are having problems.)
 
  1. Remote into it from any machine using remote access. If you are on a Mac, you might need to download an app to allow the Mac to remote into a virtual Windows machine
  2. Launch JGrasp

Part Two

  1. In the CSC121 folder, you will find a program entitled SimpleCalculator.java. Load a copy of it into JGrasp
  2. Change the name of the class to InterestRate and resave it as InterestRate.java
Changed:
<
<
  1. Change the code so that instead of getting two numbers (number1 and number2) it gets a price and an interest rate. Hint if needed. Try first without the hint
  2. Change the code so that it computes the interest. Hint if needed. Try first without the hint
  3. Change the code so that it computes the total cost. This is very similar to the previous step. Try it without looking at the hint. If you got the previous step, you should be able to get this one. Hint if needed. Try first without the hint
  4. Change the code so that it outputs both the interest and the total cost. Hint if needed. Try first without the hint
>
>
  1. Change the code so that instead of getting two numbers (number1 and number2) it gets a price and an interest rate. Hint if needed. Try first without the hint
  2. Change the code so that it computes the interest. Hint if needed. Try first without the hint
  3. Change the code so that it computes the total cost. This is very similar to the previous step. Try it without looking at the hint. If you got the previous step, you should be able to get this one. Hint if needed. Try first without the hint
  4. Change the code so that it outputs both the interest and the total cost. Hint if needed. Try first without the hint
 
  1. Add your name to banner comment as the modifier of the code
  2. Save it
  3. Test it and make sure it works
Line: 48 to 48
 
      1. what data you used to test it with
      2. what results you got for each data
      3. three different ways you could use the program
Added:
>
>
      1. a flowchart of the new program (editing the one for the sample program is fine)
 
      1. Answers to the following questions:
        1. Did you type in the code or just copy it it in and change it? Why?
        2. Did you use the virtual machine? If not, why not?
Line: 59 to 60
 
    1. submit the zip folder on canvas

Optional improvements

Changed:
<
<
Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
>
>
Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor. The advanced version should be called InterestRateAdv and you should place both .java codes in your zip folder.
 
  1. Make it so it always displays 2 (and only 2) numbers after the decimal point
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback