Lab-1
Welcome to CS 141 Lab !!!
Each lab will be 50 minutes long The basic structure of each lab will be:
A ~five minute quiz, likely using Blackboard. You will find in the corresponding quiz for each lab section on Blackboard in the Quiz section for the course.
The quiz name format is Quiz-n(tt) where n is the quiz number, and tt is the time. For instance Quiz-1(11) is quiz 1 for the 11am session, and Quiz-1(12) is quiz 1 for the 12pm session.
The quiz links will likely only be available during these first ~5 minutes of lab.
The quizzes will also likely be password protected, with the password written on the board, so you will need to be present to get the password to take the quiz.
A ~five minute overview of the tasks of the lab activity for the day.
About 30 minutes to work on the lab tasks. You must work with a partner to get credit for the lab. The two of you will complete and finish a single project. Every 10 minutes or so you should switch driver / navigator roles, which means you alternate being the person typing on the keyboard.
During the last 10 minutes of the lab the TA(s) will come around to verify your work and check off what you have done.
The TA will give you guidance when you ask a question, but will not necessarily give a way the answer. Remember to "ask three before me". If you don't understand something, first confer with your partner. If you still can't get it confer with a nearby group. If you still can't get it, get help from a TA. You are highly encouraged to help each other.
For today Mac users should group together near the entrance doors so you can more easily confer together regarding Xcode installation and running issues.
Today's lab task will be as follows:
1. (1 point) Find a partner such that at least one of you already has Xcode or Visual Studio downloaded, and preferably already installed.
- Compile and run the following simple program.
- For both Mac and Windows users you will first need to create a console project, and then within that project edit main.c (or main.cpp).
- Please refer to the course IDE page for more information.
Doing this the first time can be confusing! Expect to have to ask people around you for help to navigate your way through this. We don't expect you to already know how to do this.
// My name is Inigo Montoya.
#include <stdio.h>
int main() {
printf("Visualize Whirled Peas\n");
return 0;
}
2. (1 point) Add printf statements so that your program also displays the name, netid, and favorite dessert for both lab partners.
For instance this might look like:
Visualize Whirled Peas
Dale Reed, reed, Baklava
Nianzu Ma, nma4, Rasberry sorbet
---------------------------------------------------------------------
Extra Credit (we don't expect you to get to this section necessarily):
(1 point) Investigate and use the scanf statement to read in your age (Hint: look up scanf in Zyante.) Then use the printf statement to display your age plus one. For instance when running this your program and giving input of 20 this should look like:
Visualize Whirled Peas
Dale Reed, reed, Baklava
Nianzu Ma, nma4, Rasberry sorbet
Enter your age: 20
Next year at this time you will be 21
Without changing your program, running this program a second time for an age input of 75 should look like the following:
Visualize Whirled Peas
Dale Reed, reed, Baklava
Nianzu Ma, nma4, Rasberry sorbet
Enter your age: 75
Next year at this time you will be 76
---------------------------------------------------------------------
If you finish all this, then congratulations! Please be a resource to those around you, helping them along.
1-10-2017