Update MP1
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,2 +1,4 @@
 | 
				
			|||||||
/Assignments/lab2_CalebFontenot/build/
 | 
					/Assignments/lab2_CalebFontenot/build/
 | 
				
			||||||
/Assignments/lab2_CalebFontenot/dist/
 | 
					/Assignments/lab2_CalebFontenot/dist/
 | 
				
			||||||
 | 
					/Assignments/MP1_CalebFontenot/build/
 | 
				
			||||||
 | 
					/Assignments/MP1_CalebFontenot/dist/
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								Assignments/MP1_CalebFontenot/.dep.inc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								Assignments/MP1_CalebFontenot/.dep.inc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					# This code depends on make tool being used
 | 
				
			||||||
 | 
					DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES}))
 | 
				
			||||||
 | 
					ifneq (${DEPFILES},)
 | 
				
			||||||
 | 
					include ${DEPFILES}
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
@@ -9,8 +9,11 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * Created on February 26, 2024, 11:30 AM
 | 
					 * Created on February 26, 2024, 11:30 AM
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					#include <iomanip>
 | 
				
			||||||
#include <cstdlib>
 | 
					#include <cstdlib>
 | 
				
			||||||
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					#include <tuple>
 | 
				
			||||||
 | 
					#include <cmath>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using namespace std;
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -18,15 +21,37 @@ using namespace std;
 | 
				
			|||||||
 * 
 | 
					 * 
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					int milesPerGallon(int gallons, int milesDriven) {
 | 
				
			||||||
 * Write a program that asks for five test scores.
 | 
					    return milesDriven / gallons;
 | 
				
			||||||
 * The program should calculate theaverage
 | 
					}
 | 
				
			||||||
 * @param argc
 | 
					
 | 
				
			||||||
 * @param argv
 | 
					std::tuple<double, double> maleFemalePercentages(int maleStudents, int femaleStudents) {
 | 
				
			||||||
 * @return 
 | 
					    int totalStudents = maleStudents + femaleStudents; 
 | 
				
			||||||
 */
 | 
					    double malePercentage = (double) maleStudents / totalStudents;
 | 
				
			||||||
 | 
					    double femalePercentage = (double) femaleStudents / totalStudents;
 | 
				
			||||||
 | 
					    return {malePercentage, femalePercentage};
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					double celciusToFahrenheit(double celcius) {
 | 
				
			||||||
 | 
					    return 9.0 / 5.0 * celcius + 32.0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					double monthlySalesTax(int month, int year, double total) {
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main(int argc, char** argv) {
 | 
					int main(int argc, char** argv) {
 | 
				
			||||||
 | 
					    cout << "The car that drove 375 miles and burned 15 gallons of gasoline consumed the fuel at a rate of " << milesPerGallon(15, 375) << " MPG.\n";
 | 
				
			||||||
 | 
					    int maleStudents, femaleStudents = 0;
 | 
				
			||||||
 | 
					    //double malePercentage, femalePercentage = 0.0;
 | 
				
			||||||
 | 
					    cout << "Enter the number of male students, followed by the number of female students: ";
 | 
				
			||||||
 | 
					    cin >> maleStudents >> femaleStudents;
 | 
				
			||||||
 | 
					    auto [malePercentage, femalePercentage] = maleFemalePercentages(maleStudents, femaleStudents);
 | 
				
			||||||
 | 
					    cout << "The ratio of male to female students is " << setprecision(2) << (malePercentage * 10) << "/" << setprecision(2) <<(femalePercentage * 10) << endl;
 | 
				
			||||||
 | 
					    cout << "0C is " << std::to_string(celciusToFahrenheit(0)) << "F." << endl;
 | 
				
			||||||
 | 
					    cout << "100C is " << std::to_string(celciusToFahrenheit(100)) << "F." << endl;
 | 
				
			||||||
 | 
					    cout << "23.8889C is " << std::to_string(celciusToFahrenheit(23.8889)) << "F." << endl;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,11 +24,16 @@
 | 
				
			|||||||
      </nativedebugger>
 | 
					      </nativedebugger>
 | 
				
			||||||
      <runprofile version="9">
 | 
					      <runprofile version="9">
 | 
				
			||||||
        <runcommandpicklist>
 | 
					        <runcommandpicklist>
 | 
				
			||||||
 | 
					          <runcommandpicklistitem>"${OUTPUT_PATH}" | lolcat</runcommandpicklistitem>
 | 
				
			||||||
 | 
					          <runcommandpicklistitem>"${OUTPUT_PATH}" | /usr/bin/lolcat</runcommandpicklistitem>
 | 
				
			||||||
 | 
					          <runcommandpicklistitem>"${OUTPUT_PATH}" | /usr/bin/lolcat -f</runcommandpicklistitem>
 | 
				
			||||||
 | 
					          <runcommandpicklistitem>"${OUTPUT_PATH}" | /usr/bin/lolcat -F</runcommandpicklistitem>
 | 
				
			||||||
          <runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
 | 
					          <runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
 | 
				
			||||||
        </runcommandpicklist>
 | 
					        </runcommandpicklist>
 | 
				
			||||||
        <runcommand>"${OUTPUT_PATH}"</runcommand>
 | 
					        <runcommand>"${OUTPUT_PATH}"</runcommand>
 | 
				
			||||||
        <rundir></rundir>
 | 
					        <rundir></rundir>
 | 
				
			||||||
        <buildfirst>true</buildfirst>
 | 
					        <buildfirst>true</buildfirst>
 | 
				
			||||||
 | 
					        <console-type>2</console-type>
 | 
				
			||||||
        <terminal-type>0</terminal-type>
 | 
					        <terminal-type>0</terminal-type>
 | 
				
			||||||
        <remove-instrumentation>0</remove-instrumentation>
 | 
					        <remove-instrumentation>0</remove-instrumentation>
 | 
				
			||||||
        <environment>
 | 
					        <environment>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,4 +4,10 @@
 | 
				
			|||||||
        <activeConfTypeElem>1</activeConfTypeElem>
 | 
					        <activeConfTypeElem>1</activeConfTypeElem>
 | 
				
			||||||
        <activeConfIndexElem>0</activeConfIndexElem>
 | 
					        <activeConfIndexElem>0</activeConfIndexElem>
 | 
				
			||||||
    </data>
 | 
					    </data>
 | 
				
			||||||
 | 
					    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
 | 
				
			||||||
 | 
					    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
 | 
				
			||||||
 | 
					        <group>
 | 
				
			||||||
 | 
					            <file>file:/home/caleb/ASDV-Cpp/Assignments/MP1_CalebFontenot/main.cpp</file>
 | 
				
			||||||
 | 
					        </group>
 | 
				
			||||||
 | 
					    </open-files>
 | 
				
			||||||
</project-private>
 | 
					</project-private>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user