Closed aksnell closed 4 years ago
Awesome work!!
A few things:
I will need you to have distinct repositories for each homework assignment. Please do not commit each project to a single repository.
Please add at least one blank line between different sections of your code. Think of the different sections of your code like they are paragraphs in writing.
Let's get started
Today, we are starting our journey into development. This journey has to start somewhere. For this assignment, you will be making a program that demonstrates some programming fundamentals.
Objectives
Requirements
Make sure you have followed the setup instructions for your computer's operating system
Follow this guide to review how to create and run
C#
applicationsAll your code should place inside the
static void Main(string args[])
Explorer Mode
[x] Create a new app that does the following.
Practice Creating Variables
Create a variable (use your best judgment for type) that stores the
numberOfCupsOfCoffee
that you drink every day.Create a variable (use your best judgment for type) called
fullName
and set it equal to your full name.Create a variable (use your best judgment for type) call
today
and set it equal to today's date.Use
Console.WriteLine
and your variables,numberOfCupsOfCoffee
,fullName
, andtoday
, to output all three on one line.Practice Getting Input From the User
Ask the user for their name and store it in a variable named
userName
.Print out a greeting to the user, using their name.
Practice Getting Different Types of Input From the User
Ask the user to input two numbers.
Get the numbers as
string
s usingConsole.ReadLine
, store them in variables namedfirstNumberAsString
andsecondNumberAsString
Converting String Input Into Numbers
Convert each
string
above to adouble
using Double.parse. Save the first value in a variable namedfirstOperand
and the second value in a variable namedsecondOperand
.Doing Math
Add the operand variables from above and save the results in a variable named
sum
.Subtract the
secondOperand
variable from thefirstOperand
variable and save the results in a variable nameddifference
.Multiply the operand variables and save the results in a variable named
product
.Divide the
firstOperand
by thesecondOperand
and save the results in a variable namedquotient
.Find the remainder when one operand is divided by the other and save the results in a variable named
remainder
. See this page if you need to learn more about the modulo operator.Use
Console.WriteLine
to present the user, in a meaningful way, each of the values for thesum
,difference
,quotient
,product
, andremainder
variables. (e.g. perhaps one of your outputs is similar toIf you add 4 and 5 you get 9
if4
and5
were the input)Adventure Mode
Alice
.Epic Mode
Main
method.Additional Resources
Reading Material