Skip to content

Joe LabExam 4 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ConsoleApp3/ConsoleApp3.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
19 changes: 19 additions & 0 deletions ConsoleApp3/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;

namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to the Trig Calculator!");
Console.WriteLine("What can we help you with today?");
Console.WriteLine("1. Pythagorean Theorem");
Console.WriteLine("2. Sine, Cosine, or Tangent");
Console.WriteLine("3. Cosecant, Secant, or Cotangent");
Console.WriteLine("Please type your selection and press ENTER.");
int MMenuChoice = Convert.ToInt32(Console.ReadLine());

}
}
}
8 changes: 4 additions & 4 deletions Exercise03_2/Joe_Exercise03_2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Testing intersection of line ({0}, {1})-({2},{3}) and ({4}, {5})-({6},{7}).
,line1.p1.Y
,line1.p2.X
,line1.p2.Y
,line1.p1.X
,line1.p1.Y
,line1.p2.X
,line1.p2.Y
,line2.p1.X
,line2.p1.Y
,line2.p2.X
,line2.p2.Y
,lines_intersect
,segments_intersect
,intersection.X
Expand Down
8 changes: 8 additions & 0 deletions Gas_Mileage/Gas_Mileage.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
41 changes: 41 additions & 0 deletions Gas_Mileage/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Linq;
using System.Collections.Generic;

namespace Gas_Mileage
{
class Program
{
static void Main()
{
List<int> miles = new List<int>();
List<int> gallons = new List<int>();
List<int> final_mpg = new List<int>();

while (true)
{
Console.WriteLine("Input Miles driven, then gas used, 'q' to quit.");
Console.Write("Input Miles driven: ");
var _miles = Console.ReadLine();
if (Convert.ToString(_miles) == "q"){break;}else{miles.Add(Convert.ToInt16(_miles));}

Console.Write("Input Gallons used: ");
var _gallons = Console.ReadLine();
if (Convert.ToString(_gallons) == "q"){break;}else{gallons.Add(Convert.ToInt16(_gallons));}

Console.WriteLine("");
}

int MPG = miles.Zip(gallons, (m, g) => new {miles = m, gallons = g });

foreach (var datapoint in MPG)
{
final_mpg.Add(datapoint.Miles / datapoint.Gallons);
}

Console.WriteLine("Final MPG: {0}", (Convert.ToInt16((final_mpg.Average() * 100))) / 100);

Console.WriteLine("Done!");
}
}
}
12 changes: 12 additions & 0 deletions LabExam4_1/Joe_LabExam4_1/Joe_LabExam4_1.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\Libs\JoesLib\JoesLib.csproj" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions LabExam4_1/Joe_LabExam4_1/Joe_LabExam4_1.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="www.draw.io" modified="2020-04-13T20:49:48.303Z" agent="5.0 (Windows)" etag="P4l-Ta4Myfz6DBcopYu0" version="12.9.11" type="device"><diagram id="q5OfQOmxxatx0336DKi4" name="Page-1">3VjRbtowFP0apO1hVUIIhMeN0k7aOm1D3aS+VF5yiV05uZHjANnXz0mchNSAsmlAywvYx/di33PPiWIGziza3AqS0DsMgA+GVrAZONeD4dC2HE99FUheIe5oUgGhYIEOaoEF+w11pkYzFkDaCZSIXLKkC/oYx+DLDkaEwHU3bIm8u2tCQjCAhU+4if5kgaQV6rlWi38EFtJ6Z9vSKxGpgzWQUhLgegty5gNnJhBlNYo2M+AFeTUvVd7NntXmYAJi2SdB8m+39FOUPvz4LuEGvfcPefbOdqqfWRGe6Yr1aWVeUwCBYkRPUUiKIcaEz1v0g8AsDqDYx1KzNuYzYqJAW4FPIGWu20syiQqiMuJ6tdqz2GhvcRpKMRM+HKpIi4SIEOSBOK9pgdIuYARS5CpPACeSrbrnIFpEYRPX8qwGmuq/od1gfUbKrDvC4jdvzRZwrgRfUL2mTMIiISUHa+W5XUSuQEjYHKbSLL1OqAWrHTvS03Ur/yaEbknfs45F1ujSNOr11Oj0nBr1DNYXEgUU56ZQniLNuFQDXKqPJ4xT5HClCrpPQXzJol8gCiVbLC7EUwrlkcWPSdGH1GigejomxVDRqZwAHENBIsV6AoKpekA8X/vaLpzAFF7XE/bYNMXQ2mGK8dFMMb40U0x7msJ2z+mK6f90BW1cwWKfwqtzxcTtuKJxybYr7JO6wnxovXJX2G5fW0zO+kLjGsRfszThJH/mjCujH122T/9+4+xQ7c4XnKOpthbpBal20lO1+3p1ItVODqiWAk+WGS/boM7iF+XA5gUKeHR+AZv3mQXwZcmYiFhMJLzMu43bl7p/uNyoaXu5L9e2/iJx5n8A</diagram></mxfile>
Binary file added LabExam4_1/Joe_LabExam4_1/Joe_LabExam4_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions LabExam4_1/Joe_LabExam4_1/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using JoesLib;

namespace Joe_LabExam4_1
{
class Program
{
static void Main()
{
double weight_in_pounds = jonsole.getUserNumber(@"Welcome to the body mass index (BMI) calculator
Enter your weight in pounds: ");
double height_in_inches = jonsole.getUserNumber("Enter your height in inches: ");

Console.WriteLine("Your BMI is: {0}", Convert.ToInt16(weight_in_pounds * 703 / (height_in_inches * height_in_inches)));

Console.WriteLine(@"
BMI value, according to Department of Health and Human Services/National Institutes of Health
Underweight: less than 18.5
Normal: between 18.5 and 24.9
Overweight: between 25 and 29.9
Obese: 30 or greater");
}
}
}
12 changes: 12 additions & 0 deletions LabExam4_2/Joe_LabExam4_2/Joe_LabExam4_2.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\Libs\JoesLib\JoesLib.csproj" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions LabExam4_2/Joe_LabExam4_2/Joe_LabExam4_2.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="www.draw.io" modified="2020-04-15T02:08:09.296Z" agent="5.0 (Windows)" etag="h3vfwphZgxrYZbIs5kxw" version="12.9.11" type="device"><diagram id="0KIMbXT3AV-VgnscISk5" name="Page-1">7Zthb6M2GMc/TaTtpJ3AJhRepmnXO2l3qpqT2r6qnOACJ8DMmCbpp58NOARMet5uiVO2Ny1+sI398PPjPw9kAufp5oaiPPpCApxMgBVsJvBqAoBtQY//E5ZtbZk6F7UhpHHQVGoNi/gVy5aNtYwDXHQqMkISFudd44pkGV6xjg1RStbdas8k6V41RyFWDIsVSlTrfRywqLZ6U6u1f8JxGMkr21ZzJkWycmMoIhSQ9Z4JXk/gnBLC6qN0M8eJcJ70S93u9wNndwOjOGM6DZzl5QzCb/7tfPs6+/78ai2eHn+DdS8vKCmbCTeDZVvpARxwhzRFQllEQpKh5Lq1XlJSZgEWl7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ODo+kFZ3S5Vwh0ty1oVC+A0W9b3lD+9LTb1uhEGYSadDtG86dQDStnFouV3Khv/IMDR80ULRhHTCHW4Of8wNZ9rf0PFjUvtr9nqWVB+6sgeP0X</diagram></mxfile>
Binary file added LabExam4_2/Joe_LabExam4_2/Joe_LabExam4_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions LabExam4_2/Joe_LabExam4_2/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using JoesLib;

namespace Joe_LabExam4_2
{
class Program
{
static void Main()
{
int MAX_RANGE = 1000;
Random seed = new Random();

int magic_number = Convert.ToInt16(seed.NextDouble() * MAX_RANGE);
int userGuess = 0;
int userGuesses = 0;

Console.WriteLine(@"Welcome. To play this game, guess a number
and the computer will tell you if you're high or low.
Attempt the lowest number of guesses!
");

while (true)
{
userGuess = Convert.ToInt16(jonsole.getUserNumber("Enter a guess from 0 to " + Convert.ToString(MAX_RANGE) + ": "));
userGuesses++;
if (userGuess > magic_number)
{
Console.WriteLine("Your guess was too high, try again, You are on turn {0}", userGuesses);
}

if (userGuess < magic_number)
{
Console.WriteLine("Your guess was too low, try again. You are on turn {0}", userGuesses);
}

if (userGuess == magic_number)
{
Console.WriteLine("Your guess was correct! The number was {0}, you completed in {1} guesses.", magic_number, userGuesses);
return;
}
}
}
}
}
Binary file added Libs/dll/jonsole.dll
Binary file not shown.
Binary file added Libs/dll/jonvert.dll
Binary file not shown.
23 changes: 23 additions & 0 deletions Test/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;

namespace Test
{
class Program
{
static void Main()
{
int x = 1;
int total = 0;

while (x <= 10)
{
int y = x * x;
Console.WriteLine(y);
total += y;
++x;
}

Console.WriteLine($"Total is {total}");
}
}
}
8 changes: 8 additions & 0 deletions Test/Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>