first semester files
This commit is contained in:
27
1st-Semester-Fall-2021/CSNP/CSNP-04103-Lab-#1/Lab01-2ASharpe.cpp
Executable file
27
1st-Semester-Fall-2021/CSNP/CSNP-04103-Lab-#1/Lab01-2ASharpe.cpp
Executable file
@@ -0,0 +1,27 @@
|
||||
/***************************************************************
|
||||
* Name: Aidan Sharpe
|
||||
* Course: Computer Science & Programming
|
||||
* Class: CS04103 Section: 2
|
||||
* Assignment Date: 9/15/2021
|
||||
* File Name: Lab01-2ASharpe.cpp
|
||||
*****************************************************************
|
||||
* ID: Lab 1 Problem 2
|
||||
* Purpose: Calculate how many energy drinks and citrus drinks are being consumed out of a set of customers
|
||||
*****************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
const int CUSTOMERS = 16500;
|
||||
const float ENERGY_PERCENT = 0.15, CITRUS_PERCENT = 0.52;
|
||||
|
||||
//Calculate the number of customers that got energy drinks and the number that got citrus drinks
|
||||
cout << endl << "Out of " << CUSTOMERS << " customers: about " << int( ENERGY_PERCENT * CUSTOMERS ) << " had an energy drink, "
|
||||
<< "and about " << int( CITRUS_PERCENT * CUSTOMERS ) << " had a citrus drink." << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user