Lab-1

Welcome to CS 141 Lab !!!

Each lab will be 50 minutes long  The basic structure of each lab will be:

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