New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

CS 124 Week 3: my assignment and project code

by: Samantha Stavast

CS 124 Week 3: my assignment and project code CS 124

Marketplace > Brigham Young University - Idaho > Computer Science and Engineering > CS 124 > CS 124 Week 3 my assignment and project code
Samantha Stavast
GPA 4.0

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

These files are my original code of how I did the assignments 1.3-1.5 and project 03. I got 100% on all and you can see how I set up my functions, and comments and how the code is supposed to look.
Intro to Software Development
Brother Comeau
Class Notes
programming, software engineering, Boolean, functions, Calculations
25 ?




Popular in Intro to Software Development

Popular in Computer Science and Engineering

This 10 page Class Notes was uploaded by Samantha Stavast on Friday September 30, 2016. The Class Notes belongs to CS 124 at Brigham Young University - Idaho taught by Brother Comeau in Fall 2016. Since its upload, it has received 3 views. For similar materials see Intro to Software Development in Computer Science and Engineering at Brigham Young University - Idaho.


Reviews for CS 124 Week 3: my assignment and project code


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/30/16
/*********************************************************************** * Program: * Assignment 14, Matthew 18:21-22 * Brother C, CS124 * Author: * Samantha S * Summary: * This program will address Peter's question to the Lord in * Matthew 18:21-22 *************************************************************************/ #include <iostream> using namespace std; //prototypes so main can be our top function int questionPeter(); int responseLord(); /********************************************************************** * You are not allowed to change MAIN in any way; just implement the two * functions: questionPeter() and responseLord() ***********************************************************************/ int main() { // ask Peter's question questionPeter(); // the first part of the Lord's response cout << "Jesus saith unto him, I say not unto thee, Until seven\n"; cout << "times: but, Until " << responseLord() << ".\n"; return 0; } /********************************************************************** * Peter's question *********************************************************************/ void questionPeter() { cout << "Lord, how oft shall my brother sin against me, and I forgive him?" << "\nTill seven times?\n"; } /********************************************************************** * Lord's Response *********************************************************************/ int responseLord() { return 490; } /*********************************************************************** * Program: * Assignment 13, Covert fahrenheit to celsius * Brother C, CS124 * Author: * Samantha S * Summary: * Coverts fahrenheit to celsius **************************************************************************/ #include <iostream> // #include <math.h> using namespace std; /******************************************************************** * Coverts fahrenheit to celsius *******************************************************************/ int main() { cout.setf(ios::fixed); cout.precision(0); double fahrenheit = 0; cout << "Please enter Fahrenheit degrees: "; cin >> fahrenheit; double celsius = (5.0 / 9.0) * ( f - 32.0); cout << "Celsius: " << celsius << "\n"; return 0; } /*********************************************************************** * Program: * Assignment 15, Full Tithe Payer * Brother C, CS124 * Author: * Samantha S * Summary: * This program will compute if a user is a full tithe payer using * the complicated formula provided in the scriptures: * And after that, those who have thus been tithed shall * pay one-tenth of all their interest annually; and this * shall be a standard law unto them forever, for my holy * priesthood, saith the Lord. D&C 119:4 *************************************************************************/ #include <iostream> using namespace std; /***************************************************** * calculates true Full tithe payer if tithe is 10% or more of income *****************************************************/ bool isFullTithePayer(float income, float tithe) { return (tithe >= income * .10); } /********************************************************************** * Main will call isFullTithePayer() and display an appropriate message * to the user based on the results ***********************************************************************/ int main() { float income; float tithe; // prompt user for income cout << "Income: "; cin >> income; // prompt user for tithe cout << "Tithe: "; cin >> tithe; // give the user his tithing report if (isFullTithePayer(income, tithe)) cout << "You are a full tithe payer.\n"; else cout << "Will a man rob God? Yet ye have robbed me.\n" << "But ye say, Wherein have we robbed thee?\n" << "In tithes and offerings. Malachi 3:8\n"; return 0; } /*********************************************************************** * Program: * Project 03, Monthly Budget * Brother C, CS124 * Author: * Samantha S * Summary: * This Program will prompt and allow you to input your monthly * budget and display the results. **************************************************************************/ #include <iostream> #include <iomanip> using namespace std; //prototypes void programGreeting(); double getIncome(); double getBudgetLiving(); double getActualLiving(); double getActualOther(); double getActualTithing(); double getActualTax(); double computeTithing(double income); void display(double income, double taxes, double tithing, double budgetedLivingExpenses, double budgetTithing, double actualLivingExpenses, double other); /********************************************************************** * This Program will prompt and allow you to input your monthly * budget and display the results. ************************************************************************/ int main() { //Configure the display to show two decimal points for money cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2); programGreeting(); double income = getIncome(); double budgetedLivingExpenses = getBudgetLiving(); double actualLivingExpenses = getActualLiving(); double taxes = getActualTax(); double tithing = getActualTithing(); double budgetTithing = computeTithing(income); double other = getActualOther(); display(income, taxes, tithing, budgetTithing, budgetedLivingExpenses, actualLivingExpenses, other); return 0; } /************************************************************************* * Program Greeting: Puts out text explaining program and prompt for values ************************************************************************/ void programGreeting() { cout << "This program keeps track of your monthly budget\n"; cout << "Please enter the following:\n"; } /************************************************************************* * function prompt for income ************************************************************************/ double getIncome() { double income; cout << "\tYour monthly income: "; cin >> income; return income; } /************************************************************************* * function prompt for budgeted living expenses ************************************************************************/ double getBudgetLiving() { double budgetedLivingExpenses; cout << "\tYour budgeted living expenses: "; cin >> budgetedLivingExpenses; return budgetedLivingExpenses; } /************************************************************************* * function prompt for actual living expenses ************************************************************************/ double getActualLiving() { double actualLivingExpenses; cout << "\tYour actual living expenses: "; cin >> actualLivingExpenses; return actualLivingExpenses; } /************************************************************************* * function prompt for other expenses ************************************************************************/ double getActualOther() { double other; cout << "\tYour actual other expenses: "; cin >> other; return other; } /************************************************************************* * function prompt for budgeted tithing ************************************************************************/ double getActualTithing() { double tithing; cout << "\tYour actual tithe offerings: "; cin >> tithing; return tithing; } /************************************************************************* * function prompt for taxes ************************************************************************/ double getActualTax() { double taxes; cout << "\tYour actual taxes withheld: "; cin >> taxes; return taxes; } /************************************************************************* * calculates budgeted "other" amount ************************************************************************/ double computeBudgetOther(double income, double budgetedLivingExpenses, double budgetTithing) { double budgetOther = (income - budgetTithing - budgetedLivingExpenses); return budgetOther; } /************************************************************************* * calculates actual difference from budgeted ************************************************************************/ double computeActualDifference(double income, double taxes, double tithing, double actualLivingExpenses,double other) { double actualDifference = (income - taxes - tithing - actualLivingExpenses - other); return actualDifference; } /************************************************************************* * calculates budgeted tithing amount at 10% of income ************************************************************************/ double computeTithing(double income) { return (income * 0.1); } /************************************************************************* * calculates tax, returns 0 for now ************************************************************************/ double computeTax() { return 0; } /************************************************************************* * displays results and entered information ************************************************************************/ void display(double income, double taxes, double tithing, double budgetTithing,double budgetedLivingExpenses, double actualLivingExpenses, double other) { // add extra space between sections cout << "\n"; //The reported results cout << "The following is a report on your monthly expenses\n"; cout << "\tItem Budget Actual\n"; cout << "\t=============== =============== ===============\n"; cout << "\tIncome $" << setw(11) << income << " $" << setw(11) << income << "\n"; cout << "\tTaxes $" << setw(11) << computeTax() << " $" << setw(11) << taxes << "\n"; cout << "\tTithing $" << setw(11) << budgetTithing << " $" << setw(11) << tithing << "\n"; cout << "\tLiving $" << setw(11) << budgetedLivingExpenses << " $" << setw(11) << actualLivingExpenses << "\n"; cout << "\tOther $" << setw(11) << computeBudgetOther(income, budgetTithing, budgetedLivingExpenses) << " $" << setw(11) << other << "\n"; cout << "\t=============== =============== ===============\n"; cout << "\tDifference $ 0.00 $" << setw(11) << computeActualDifference(income, taxes, tithing, actualLivingExpenses, other) << "\n"; }


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.