first semester files

This commit is contained in:
2024-02-22 14:31:08 -05:00
parent 0f26c9f73d
commit 2d4bbf49a4
242 changed files with 360411 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
/***************************************************************
* Name: Aidan Sharpe
* Course: Computer Science & Programming
* Class: CS04103 Section: 6
* Assignment Date: 10.11.2021
* File Name: Homework3-1ASharpe.cpp
*****************************************************************
* ID: Homework 3 Problem 1
* Purpose: Compare the sizes of two rectangles
*****************************************************************/
#include <iostream>
using namespace std;
int main()
{
int areas[2];
for ( int i = 0; i < 2; i++ )
{
int width, height;
cout << "Enter width: ";
cin >> width;
cout << "Enter height: ";
cin >> height;
areas[i] = width * height; // set area of rectangle
}
// figure out which rectangle has the larger area (if any) and print the result
cout << ((areas[0] > areas[1]) ? "Rect 1 is bigger." : (areas[1] > areas[0]) ? "Rect 2 is bigger." : "They are the same size.");
return 0;
}