Fall 2016

Lab06
BankAccount in Ruby

Due: Tuesday November 10, 2015 11:59 PM

Lab06 - BankAccount in Ruby

Requirements

A readable ruby program is produced5 pts
Program runs without errors or warnings5 pts
Program conforms to logic as indicated in the pseudocode40 pts
Total50 pts

Resources

Objective

To translate a pseudocode into programming code

Instructions

Attached to this assignment you'll find three files, planet_weight.txt and planet_weight.rb. the txt file is the pseudocode that was used to write the rb file which is written in the Ruby programming language. Study the pseudocode and the ruby code side by side and make notes of how the following things are done in Ruby:

  • modules are written, values are passed and returned, how they're called
  • control structures are written, if statements, do/while and while statements
  • input and output is performed, how are literal and variable strings displayed, how to get numbers from the user

With those elements of the Ruby language in mind, translate the attached bankaccount pseudocode for managing the balance of a bank account into a working Ruby program.

You can test your Ruby code in a modern web browser by going to repl.it or by installing Ruby on your computer.