added old projects

This commit is contained in:
Austin Bennett
2026-02-03 08:18:39 -06:00
parent 43acf989bf
commit 2451448b8a
623 changed files with 28117 additions and 0 deletions
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,296 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objects = {
/* Begin PBXBuildFile section */
D9284A5828772A1E00E2460C /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284A5728772A1E00E2460C /* main.cpp */; };
D9284A822877D01D00E2460C /* sphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284A802877D01D00E2460C /* sphere.cpp */; };
D9284A852877D25A00E2460C /* planet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284A832877D25A00E2460C /* planet.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
D9284A5228772A1E00E2460C /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
D9284A5428772A1E00E2460C /* Planet */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Planet; sourceTree = BUILT_PRODUCTS_DIR; };
D9284A5728772A1E00E2460C /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
D9284A802877D01D00E2460C /* sphere.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = sphere.cpp; sourceTree = "<group>"; };
D9284A812877D01D00E2460C /* sphere.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = sphere.hpp; sourceTree = "<group>"; };
D9284A832877D25A00E2460C /* planet.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = planet.cpp; sourceTree = "<group>"; };
D9284A842877D25A00E2460C /* planet.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = planet.hpp; sourceTree = "<group>"; };
D9284A872877DA7B00E2460C /* input.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D9284A5128772A1E00E2460C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
D9284A4B28772A1E00E2460C = {
isa = PBXGroup;
children = (
D9284A5628772A1E00E2460C /* Planet */,
D9284A5528772A1E00E2460C /* Products */,
);
sourceTree = "<group>";
};
D9284A5528772A1E00E2460C /* Products */ = {
isa = PBXGroup;
children = (
D9284A5428772A1E00E2460C /* Planet */,
);
name = Products;
sourceTree = "<group>";
};
D9284A5628772A1E00E2460C /* Planet */ = {
isa = PBXGroup;
children = (
D9284A872877DA7B00E2460C /* input.h */,
D9284A5728772A1E00E2460C /* main.cpp */,
D9284A802877D01D00E2460C /* sphere.cpp */,
D9284A832877D25A00E2460C /* planet.cpp */,
D9284A812877D01D00E2460C /* sphere.hpp */,
D9284A842877D25A00E2460C /* planet.hpp */,
);
path = Planet;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D9284A5328772A1E00E2460C /* Planet */ = {
isa = PBXNativeTarget;
buildConfigurationList = D9284A5B28772A1E00E2460C /* Build configuration list for PBXNativeTarget "Planet" */;
buildPhases = (
D9284A5028772A1E00E2460C /* Sources */,
D9284A5128772A1E00E2460C /* Frameworks */,
D9284A5228772A1E00E2460C /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = Planet;
productName = Planet;
productReference = D9284A5428772A1E00E2460C /* Planet */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D9284A4C28772A1E00E2460C /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastUpgradeCheck = 1340;
TargetAttributes = {
D9284A5328772A1E00E2460C = {
CreatedOnToolsVersion = 13.4.1;
};
};
};
buildConfigurationList = D9284A4F28772A1E00E2460C /* Build configuration list for PBXProject "Planet" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = D9284A4B28772A1E00E2460C;
productRefGroup = D9284A5528772A1E00E2460C /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D9284A5328772A1E00E2460C /* Planet */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
D9284A5028772A1E00E2460C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D9284A852877D25A00E2460C /* planet.cpp in Sources */,
D9284A822877D01D00E2460C /* sphere.cpp in Sources */,
D9284A5828772A1E00E2460C /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
D9284A5928772A1E00E2460C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 12.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
D9284A5A28772A1E00E2460C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 12.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
};
name = Release;
};
D9284A5C28772A1E00E2460C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = N3GD25M5J3;
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
D9284A5D28772A1E00E2460C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = N3GD25M5J3;
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D9284A4F28772A1E00E2460C /* Build configuration list for PBXProject "Planet" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D9284A5928772A1E00E2460C /* Debug */,
D9284A5A28772A1E00E2460C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D9284A5B28772A1E00E2460C /* Build configuration list for PBXNativeTarget "Planet" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D9284A5C28772A1E00E2460C /* Debug */,
D9284A5D28772A1E00E2460C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D9284A4C28772A1E00E2460C /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Planet.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Binary file not shown.
BIN
View File
Binary file not shown.
+49
View File
@@ -0,0 +1,49 @@
/*
* Header file for ReadValue
*/
#include <iostream>
#include <climits>
#include <string>
template<typename inputType>
inputType ReadValue(std::string prompt)
{
inputType returnValue=0;
std::cout << prompt;
std::cin >> returnValue;
while (std::cin.fail()) {
std::cout << "Error! Cannot read input.\n";
std::cin.clear();
std::cin.ignore(INT_MAX,'\n');
std::cout << prompt;
std::cin >> returnValue;
}
return returnValue;
}
template<typename inputType>
inputType ReadValue(std::string prompt, inputType minValue)
{
inputType returnValue=0;
returnValue=ReadValue<inputType>(prompt);
while (returnValue < minValue) {
std::cout << "Error! Value must be >= " << minValue << std::endl;
returnValue=ReadValue<inputType>(prompt);
}
return returnValue;
}
template<typename inputType>
inputType ReadValue(std::string prompt, inputType minValue, inputType maxValue)
{
inputType returnValue=0;
returnValue=ReadValue<inputType>(prompt,minValue);
while (returnValue > maxValue) {
std::cout << "Error! Value must be <= " << maxValue << std::endl;
returnValue=ReadValue<inputType>(prompt,minValue);
}
return returnValue;
}
+28
View File
@@ -0,0 +1,28 @@
//
// main.cpp
// Planet
//
// Created by Austin Bennett on 7/7/22.
//
/*
Your planet class will be derived from your sphere class. It should add mass as a private member (with mutator and accessor) along with a constructor and functions to calculate density and acceleration due to gravity at the surface. Functions for input and display are optional.
Using this class, write a program that will prompt the user for the radius and mass of a planet. Your program will display the surface area, density and acceleration due to gravity at the surface.
*/
#include <iostream>
#include "planet.hpp"
#include "input.h"
using namespace std;
int main(int argc, const char * argv[]) {
double radius = ReadValue<double>("Radius: ");
double mass = ReadValue<double>("Mass: ");
Planet earth = Planet(radius, mass);
earth.display();
return 0;
}
+41
View File
@@ -0,0 +1,41 @@
//
// planet.cpp
// Planet
//
// Created by Austin Bennett on 7/7/22.
//
#include <iostream>
#include <cmath>
#include "planet.hpp"
using namespace std;
double _mass;
double _density;
double _accDueToGravity;
double Planet::getMass() {
return _mass;
}
void Planet::setMass(double mass) {
_mass = mass;
}
Planet::Planet(double radius, double mass) {
_mass = mass;
setRadius(radius);
setSurfaceArea(4 * M_PI * (radius * radius));
setVolume((4/3) * M_PI * (radius * radius * radius));
_density = _mass / getVolume();
_accDueToGravity = (9.8 * _mass) / (getRadius() * getRadius());
}
void Planet::display() {
cout << "Mass: " << _mass << "\n";
cout << "Density: " << _density << "\n";
cout << "Acceleration Due To Gravity: " << _accDueToGravity << "\n";
}
+26
View File
@@ -0,0 +1,26 @@
//
// planet.hpp
// Planet
//
// Created by Austin Bennett on 7/7/22.
//
#ifndef planet_hpp
#define planet_hpp
#include <stdio.h>
#include "sphere.hpp"
class Planet: private Sphere {
private:
double _mass;
double _density;
double _accDueToGravity;
public:
double getMass();
void setMass(double mass);
Planet(double radius, double mass);
void display();
};
#endif
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
//
// sphere.cpp
// Planet
//
// Created by Austin Bennett on 7/7/22.
//
#include <cmath>
#include "sphere.hpp"
double _radius;
double _surfaceArea;
double _volume;
double Sphere::getRadius() {
return _radius;
}
double Sphere::getVolume() {
return _volume;
}
void Sphere::setRadius(double radius) {
_radius = radius;
}
void Sphere::setSurfaceArea(double surfaceArea){
_surfaceArea = surfaceArea;
}
void Sphere::setVolume(double volume) {
_volume = volume;
}
Sphere::Sphere(double radius) {
_radius = radius;
_surfaceArea = 4 * M_PI * (radius * radius);
_volume = (4/3) * M_PI * (radius * radius * radius);
}
Sphere::Sphere(){
}
+28
View File
@@ -0,0 +1,28 @@
//
// sphere.hpp
// Planet
//
// Created by Austin Bennett on 7/7/22.
//
#ifndef sphere_hpp
#define sphere_hpp
#include <stdio.h>
class Sphere {
private:
double _radius;
double _surfaceArea;
double _volume;
public:
double getRadius();
double getVolume();
void setRadius(double radius);
void setSurfaceArea(double surfaceArea);
void setVolume(double volume);
Sphere(double radius);
Sphere();
};
#endif /* sphere_hpp */