Copy Link
Add to Bookmark
Report

The Hogs of Entropy 0557

eZine's profile picture
Published in 
The Hogs of Entropy
 · 5 years ago

  

[--------------------------------------------------------------------------]
ooooo ooooo .oooooo. oooooooooooo HOE E'ZINE RELEASE #557
`888' `888' d8P' `Y8b `888' `8
888 888 888 888 888 "My First C++ Program"
888ooooo888 888 888 888oooo8
888 888 888 888 888 " by Seaya
888 888 `88b d88' 888 o 4/6/99
o888o o888o `Y8bood8P' o888ooooood8
[--------------------------------------------------------------------------]

// Hello hoe readers! I, Seaya, have accomplished a most
// amazing feat! I have completed my first C++ program.
// It is a bootlegging program in which you enter the
// number of desired quarts, and the price of certain
// ingredients on the market, and voila it spits out
// the suggested price per quart. Below is the code,
// plus comments from my T.A. as to the stupendousness
// of my first effort and the lacking of proper formatting.
//
// The url of the assignment is:
// http://www.cs.georgetown.edu/~maloof/cosc071/project1.html
//
// Compile and enjoy!!!

#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>

int main ( )
{

double fullRecipes; //#of full recipes needed, apple bushels, sugar bags
int waterVolume, // gallons of original mash and packages of yeast
yieldQuarts; // desired yield in quarts
float yieldGallons, // the desired yield in gallons
appleCost, // cost of 1 bushel of apples
cost, // cost of all the jars plus the bribe and ingredients
sheriffBribe, // pay the sheriff some dough
jarPrice; // suggestions of what to charge for 100% profit

cout << "
Enter desired number of full quarts: "; // request for quarts
cin >> yieldQuarts; // input of quarts of yield

if (yieldQuarts > 128) {
cout << "
\nGallons of mash exceeds volume of still." << endl; //
overflowing!
getch();
exit(1); // sends failure message ands exits
}
else {
cout << "
\nEnter cost of apples per bushel: "; // request for bushels
cin >> appleCost; // input of the cost of an apple bushel
cout << "
\nEnter sheriff payoff: "; // sneaky bribe to sheriff he he he!
cin >> sheriffBribe; // how much to the sheriff

yieldGallons = yieldQuarts/4; // 4 quarts in a gallon
fullRecipes = ceil(yieldGallons/3.2); // each recipe yields 3.2 gals
waterVolume = fullRecipes*5; // 5 gallons in 1 recipe
cost = sheriffBribe + (yieldQuarts * 2.75) + (fullRecipes * 2.75) +
(appleCost * fullRecipes);

// the cost of the entire batch of moonshine =
// the number of quarts yielded times the price of a jar
// plus the number of full recipes made times the prices of the
// ingredients in one recipe (assuming water is free)
// plus the pesky bribe to the sheriff

jarPrice = (cost/yieldQuarts) * 2;

// The price of one jar is
// the total cost divided by the number of quarts yielded
// then multiplied by 2 for a 100% profit

cout << "
\nNeeded ingredients:\n";
cout << "
" << waterVolume << " gallons of water,\n"; // initial gallons
h2o
cout << "
" << fullRecipes << " bushels of apples,\n"; // how many
bushels
cout << "
" << fullRecipes << " bags of sugar,\n"; // # bags of
sugar=bushels
cout << "
" << waterVolume << " packages of yeast.\n\n"; // pkgs
yeast=gal. h2o
cout << "
Yield: " << yieldQuarts << " quarts\n"; // yield in quarts
cout << "
Suggested Quart Price: $" << setprecision(2) // set for cents
<< setiosflags(ios:: fixed | ios::showpoint) // necessary for dollar
format
<< jarPrice << endl; // what to charge per jar

}// end of else
getch();
return (0); // sends success

}// end of main

/* Good job, Leah. Try to work on formatting your program a little
more clearly,
it makes it much more readable and easier to follow. Your comments
in the
program are excellent. 5/5
-Seth */


end text

[--------------------------------------------------------------------------]
[ (c) !LA HOE REVOLUCION PRESS! HOE #557 - WRITTEN BY: SEAYA - 4/6/99 ]

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Francesco's profile picture
Francesco Arca (@Francesco)
14 Nov 2024
Congratulations :)

guest's profile picture
@guest
12 Nov 2024
It is very remarkable that the period of Atlantis’s destruction, which occurred due to earthquakes and cataclysms, coincides with what is co ...

guest's profile picture
@guest
12 Nov 2024
Plato learned the legend through his older cousin named Critias, who, in turn, had acquired information about the mythical lost continent fr ...

guest's profile picture
@guest
10 Nov 2024
الاسم : جابر حسين الناصح - السن :٤٢سنه - الموقف من التجنيد : ادي الخدمه - خبره عشرين سنه منهم عشر سنوات في كبرى الشركات بالسعوديه وعشر سنوات ...

lostcivilizations's profile picture
Lost Civilizations (@lostcivilizations)
6 Nov 2024
Thank you! I've corrected the date in the article. However, some websites list January 1980 as the date of death.

guest's profile picture
@guest
5 Nov 2024
Crespi died i april 1982, not january 1980.

guest's profile picture
@guest
4 Nov 2024
In 1955, the explorer Thor Heyerdahl managed to erect a Moai in eighteen days, with the help of twelve natives and using only logs and stone ...

guest's profile picture
@guest
4 Nov 2024
For what unknown reason did our distant ancestors dot much of the surface of the then-known lands with those large stones? Why are such cons ...

guest's profile picture
@guest
4 Nov 2024
The real pyramid mania exploded in 1830. A certain John Taylor, who had never visited them but relied on some measurements made by Colonel H ...

guest's profile picture
@guest
4 Nov 2024
Even with all the modern technologies available to us, structures like the Great Pyramid of Cheops could only be built today with immense di ...
Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT