Skip to content

Instantly share code, notes, and snippets.

@echo0209
echo0209 / gist:7a6e891d96b3e34cc8fa
Created November 19, 2014 09:20
Start Search
/**
Project: Star Search
A particular talent competition has five judges, each of whom awards a score between
0 and 10 to each performer. Fractional scores, such as 8.3, are allowed.
A performerís final score is determined by dropping the highest and the lowest score
received, then averaging the three remaining scores. Write a program that calculates
the score of each performer and determines the winner.
Assume thereís only one winner!
Input: Read data from an input file named performers.txt.
@echo0209
echo0209 / gist:600fcdd0fe84935f8443
Created November 5, 2014 08:16
Check Out Calculator
/**
Write a program that acts as a self-checkout register at a store and lets the user buy 2 items.
First call the "signature" function you wrote for Program 3A.
The program will prompt the user and read in:
- the name of item 1, such as mechanical pencil.
- the price of item 1 and number of items 1, such as: 2 2.50
- the name of item 2, such as binder
- the price of item 2 and the number of items 2, such as: 3 7.25
Read both the price and the number in one C++ statement
@echo0209
echo0209 / gist:3efcd1d8bc4b751eb080
Created November 5, 2014 06:07
CIS-22A-Guessing Game
/**
Guessing Game:
This is a simple guessing game between a computer and a player. First, the computer prompts the player to enter his/
her name then it generates a random number between 10 and 30. The player has up to five tries to guess the number.
After each guess, the program displays messages such as “Congratulations Susan, you’ve guessed the number in 2
tries!”, or “Sorry, the random number was 8!” . Ask the player if s/he wants to play again (Y or y for yes, anything
else for no) “Susan, would you like to play again?”. When the current player is done, ask for another player and start
all over again: “Would somebody else want to play?”