First Program

05 Jan 2023 - 13:48 | Version 1 |

Learning Objective(s)

  1. Get the environment up and working
  2. Enter your first program

Overview of the Program

This lab has two parts. Part one is to create a virtual machine in which you will store all work for this class. Part two is to edit a program to change its functionality a little.

Specifics

Part One

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!
    2. Create a project in the csc121sp2023 folder using your name
    3. invoke the shell
    4. enter: gcloud config set project {your project id (not name)}
    5. enter the following
        gcloud compute instances create {YOUR INSTANCE NAME} \
                 --image-project csc121s2023classproject \
                 --image csc121s2023windows
  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 CircleArea.java. Load it into JGrasp
  2. Change the name of the class to ConvertToCelsius and resave it as ConvertToCelsiusjava
  3. Change the code so that instead of getting a radius from the user, it gets the temperature in Fahrenheit.
  4. Change the code so that it outputs the temperature in Celsius.
  5. Add your name to banner comment as the modifier of the code
  6. Save it
  7. Test it and make sure it works
  8. Once it works
    1. create a document that contains your name, what data you used to test it with and what results you got for each data.
    2. create a pdf document from that document
    3. create an empty zip folder
    4. place ConvertToCelsius.java into it
    5. place your pdf document into it
    6. submit the zip folder on canvas

Optional improvements

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.
  1. Allow the user to specify which direction (Fahrenheit to Celsius or Celsius to Fahrenheit) and output the appropriate result.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine