chopshop-166 / tasks

Repository for tracking tasks
0 stars 0 forks source link

Formalize Software Training "Example Problems" #6

Open ghost opened 6 years ago

ghost commented 6 years ago

Need to take all the notepad++ example problems Bill wrote last year and "formalize" them for software training. These are example programs students should write to test specific skills. Ideally we should organize these by "skill tested" and put them in some timeline matching how training teaches new skills.

msoucy commented 6 years ago

Some tasks:

ghost commented 6 years ago

Problem 1: Determine Perfect Numbers

Problem 2: Determine Happy Numbers

Problem 3: Turtle Class Create a class for a Turtle then create three turtles print their info info for each turtle:

print format: "[name] is a [color] turtle that weighs [weight] pounds and is [age] years old" "Frank is a blue turtle that weighs 50 pounds and is 15 years old"

Problem 4: Car Class create a class to store information about a car

the class should be able to do the following thing

ghost commented 6 years ago

Array Exercise 3a

Write a program which takes eight numbers form the user, stores them in an array, then find and print any duplicate numbers

Array Exercise 3b

Write a program which stores these numbers: { 5, 9, -3, 100, 2, -80, 1000} then asks the user for an input until they enter one of the numbers in the list, or they fail three times

Array Exercise 4

Write a program which takes four numbers from the user, then prints those four numbers, then takes three more numbers from the user, store them as an array of seven numbers, then print that large set all at once

Array Exercise 5

Write a program which starts with the following array: { 3, 7, 10, -4, 1, 0, 8} then sorts them in decending order, and prints them

ghost commented 6 years ago

Class Exercise 1

create a class to describe a backpack, that stores the following info: color, number of pockets, padding yes or no, water bottle holder yes or no number of books inside, calculator inside yes or no, phone inside yes or no make sure you decide which are PUBLIC and which are PRIVATE add functions to access PRIVATE properties also add functions for adding / removing books, adding / removing phone make sure these functions guard against impossible cases (remove a book when none are in there)

Class Exercise 2

Create a class to describe a turtle, that stores the following info: name, color, age, weight, and speed add functions to create a new turtle (with a name and color), a function to make the turtle older (years older and pounds heavier), and a function that prints a description of the turtle (in a full sentence) speed should be calculated internally by the following function: Speed = (Age 10) - (Weight * 2) the turtle's speed should be calculated whenever it get's older

ghost commented 6 years ago

Guessing Game

Write a program which plays a guessing game with the user The program picks a random number and the user must guess it The goal is to guess the number in a few guesses as possilbe

The program should ask the user for a level setting: 1, 2, or 3 level 1 generates a random number between 1 and 10 level 2, between 1 and 100 level 3, between 1 and 1000 The program should print a final score once complete score is the the max number to guess, minus the number of guesses the user took to guess correctly *higher scores are better! The program should end (game over) if the user guesses 0

*create a class called "RandomNumber" which holds the number to guess this class should also have controls for the different levels