first semester files
This commit is contained in:
25
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-1ASharpe.cpp
Executable file
25
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-1ASharpe.cpp
Executable file
@@ -0,0 +1,25 @@
|
||||
/***************************************************************
|
||||
* Name: Aidan Sharpe
|
||||
* Course: Computer Science & Programming
|
||||
* Class: CS04103 Section: 6
|
||||
* Assignment Date: 10.11.2021
|
||||
* File Name: Homework04-1ASharpe.cpp
|
||||
*****************************************************************
|
||||
* ID: Homework 4 Problem 1
|
||||
* Purpose: Display ASCII characters 32-127
|
||||
*****************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
for ( int i = 32; i < 128; i++) // for characters 32-127
|
||||
{
|
||||
if (!(i % 16)) // newline after every 16 ASCII chars
|
||||
cout << endl;
|
||||
cout << char(i) << ' '; // print the ASCII char followed by a space
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-1ASharpe.exe
Executable file
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-1ASharpe.exe
Executable file
Binary file not shown.
41
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-2ASharpe.cpp
Executable file
41
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-2ASharpe.cpp
Executable file
@@ -0,0 +1,41 @@
|
||||
/***************************************************************
|
||||
* Name: Aidan Sharpe
|
||||
* Course: Computer Science & Programming
|
||||
* Class: CS04103 Section: 6
|
||||
* Assignment Date: 10.11.2021
|
||||
* File Name: Homework04-2ASharpe.cpp
|
||||
*****************************************************************
|
||||
* ID: Homework 4 Problem 2
|
||||
* Purpose: Display distance covered at different time periods
|
||||
*****************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int mph, time;
|
||||
|
||||
// get user inputs
|
||||
cout << "Enter speed in MPH: ";
|
||||
cin >> mph;
|
||||
cout << "Enter time of trip in hours: ";
|
||||
cin >> time;
|
||||
|
||||
// formatting things
|
||||
cout << "*********************************" << endl;
|
||||
cout << "* Hour\t* Miles Traveled\t*" << endl;
|
||||
cout << "*********************************" << endl;
|
||||
|
||||
// distance traveled after each hour
|
||||
for (int i = 0; i < time; i++)
|
||||
{
|
||||
cout << "* " << i << "\t* " << i * mph << "\t\t\t*" << endl;
|
||||
}
|
||||
|
||||
// more formatty things
|
||||
cout << "*********************************" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-2ASharpe.exe
Executable file
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#4/Homework04-2ASharpe.exe
Executable file
Binary file not shown.
Reference in New Issue
Block a user