0% found this document useful (0 votes)
5 views

Lab0

The document outlines the first lab session for CS101, scheduled for July 30-31, 2024, where students are introduced to their groups and TAs, and provided with essential resources and tools for the course. It includes instructions for logging into IITB SSO, filling out a survey form, and accessing the CS101 home page, along with detailed steps for installing software and writing simple programs. Additionally, it explains how to use the Bodhitree platform for submitting lab work and provides solutions for initial programming exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lab0

The document outlines the first lab session for CS101, scheduled for July 30-31, 2024, where students are introduced to their groups and TAs, and provided with essential resources and tools for the course. It includes instructions for logging into IITB SSO, filling out a survey form, and accessing the CS101 home page, along with detailed steps for installing software and writing simple programs. Additionally, it explains how to use the Bodhitree platform for submitting lab work and provides solutions for initial programming exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

CS101 Autumn 2024 (30th July and 31st July 2024)

Lab - 0
Welcome all to the first lab of CS101. Today, let’s look at the various tools and software that we will be using
throughout the course. However, before going into the details first, let’s get started with introducing yourselves
to your group members.

Chap 1: Introduction
All of you have been divided into groups, where each group has roughly 10 to 13 students and a group ID is
assigned for that group. If all of you are seated according to the seating plan, then your group members should be

😀
very close to the row that you are seated at. Give hi-fi to them and get to know each other. Do not talk for a long
time . Each group has been assigned a TA. He/She will guide and help you throughout this course. Treat them
like your friends but with respect. Feel free to ask them anything related to the technical doubts that you have.
Again, if you are seated according to the seating plan, your TA will be somewhere around you (non-seated). Say
hello to him/her.

You are seated in a lab having computers/laptops, hence, please do not unplug any existing equipment i.e. power
cables, LAN cable, keyboard, mouse, etc. Also, handle/use the lab equipment and furniture with care.

If you do not have a laptop and are using the desktop/laptop of the lab and you are facing some issues with the
machine, please contact your TA first. If you are not able to locate your TA, just raise your hand; a nearest TA
will help you.

1.​ IITB SSO


Open a browser and browse https://sso.iitb.ac.in/ and enter your LDAP id, password, and OTP. Click
Login. For more information, please visit: https://www.cc.iitb.ac.in/page/services-sso

​ Use https://internet.iitb.ac.in/logout.php to login into the internet

2.​ Survey Form


If you have not filled up the google form, please fill it up: https://forms.gle/YsLyK6GcGxQpfL1M9

3.​ CS101 Home Page: https://www.cse.iitb.ac.in/~cs101/


On this site all lecture material will be uploaded. Please bookmark this site for ready reference. Please go
through all the links on this site like (Schedule, Know your TAs, Lectures, Exam Corner)
Chap 2: Installation of Simplecpp (s++) Windows Users
Skip this part if you are using the machine provided by IIT, as simplecpp is already installed. Proceed to Chap 4.

1.​ Go to Virtual Box website and download the software for your OS (Windows hosts).
https://www.virtualbox.org/wiki/Downloads

2.​ Install the downloaded software as you would gnerally. I.e. double click on the .exe file and follow the steps
on the screen. Step by step screenshots are shared below for your reference
a.​ You will be prompted to proceed ahead. Click Next on this screen. If you do not see this screen
and see an error message stating that there is Visual C++ dependency to be installed, then go to
this link and download Visual C++. Ask a TA for help.
https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-
microsoft-visual-c-redistributable-version. Choose the link next to x86. X86 is nothing but the
processor architecture. If you are unsure, please ask a TA.
b.​ Click Yes to proceed with the installation

c.​ Finally, click Install

3.​ Go to this link and download CS101-Xubuntu.ova file. Ignore if you have already done so.
You can use any of the following two link
https://drive.google.com/drive/folders/1L7s9Vltdnc6R3J2TGJ40kNLOFzBIyDvE?usp=sharing
OR
https://iitbacin-my.sharepoint.com/:u:/g/personal/p11119_iitb_ac_in/Eb1AIFE5691KghW5q1ccw6UBYm0xX
Vp-WhIHYLSKUSynGA?e=uWFQTp
4.​ Open the VirtualBox app you installed. Click File > Import Appliance

5.​ Click on the browse icon highlighted in red

6.​ Select the file you downloaded (CS101-Xubuntu.ova)


7.​ Click Next. Note that Importing may take a few minutes. Please wait for it to complete

8.​ Click Finish to complete the setup.

9.​ Select CS101-Xubuntu in the left pane and click on the green color Start icon on the right
10.​If you see this, then it is just a warning. So, click ‘ok’. Ignore this and move ahead to the next step if you do
not get this.

11.​When prompted for the password, enter cs101lab and click Login.
Chap 3: Installation of Simplecpp (s++)
Linux / Ubuntu / Mac Users

Skip the installation point if you are using the machine provided by IIT, as simplecpp is already installed.
1.​ Mac or Linux: Click on the link given below.​
https://drive.google.com/drive/folders/1oSJ1nW2tNlxi18ecq0gqTNwC87xmHwKM?usp=sharing
2.​ Based on the operating system that you use, view the video and follow the instructions to install
simplecpp.

Chap 4: Writing and Executing a Simple Program and Moving Ahead

1.​ Let’s write and execute a program (All users)


a.​ Open a command line terminal:
i.​ On the Ubuntu/Linux machines press Alt + Ctrl + t keys simultaneously
ii.​ On the Mac machine, start the Terminal either by clicking on the Terminal icon or going to the
launcher and searching for Terminal
iii.​ Windows users: Assuming that you are in CS101-Xubuntu virtual box, you can open up the
terminal by pressing Alt + Ctrl + t
b.​ Type vim mysquare.cpp and press enter. A blank file will open up
c.​ To start typing, first, press the i key on the keyboard i.e. we will be in Insert mode
d.​ Type the following program
#include<simplecpp>
main_program {
turtleSim();
repeat(4) {
forward(100);
left(90);
}
wait(5);
}
e.​ To save and exit, first press the Esc key on the keyboard and then type :wq
f.​ To compile, type s++ mysquare.cpp and press enter
g.​ Since no message/text was displayed, that means that the code has compiled successfully.
h.​ To view the output, type ./a.out and press enter. You should see the following output
i.​ Note that you can use any other text editor as well like Gedit/Notepad/VScode.
2.​ Basic Linux Commands for practice
These are to be executed on the command line. Open the terminal as usual.
i.​ pwd
Print working directory. This command prints the path of your current directory.
Type pwd and press enter and observe what it prints.
ii.​ ls
List files. Type ls and press enter. This command will display all the files and folders
present in your directory
iii.​ mkdir
Make/Create directory. Type mkdir <yourname> and press enter. ​
E.g. mkdir amita This will create a directory with the name ‘amita’ that you gave.
Type ls and press enter. Check if you see the directory that you just created
iv.​ cd
This refers to changing the directory. This command allows us to navigate into a certain
directory. Type cd <DirectoryName>. E.g. cd amita and press enter. To confirm
the path type pwd.
v.​ cd ..
This command takes us one level up in the directory. Type cd .. and press enter. Check
the path by typing pwd
Chap 5: Bodhitree
https://robin.bodhi.cse.iitb.ac.in
It is a platform where all the weekly labs, and lab exams will need to be submitted.

1.​ You would have received an email from [email protected] on Tues, 30th July around
12:00pm to 12:30pm. Please check your spam folder also. This means that your Bodhitree account has been
created successfully. An email will be similar to the one given below. Click on the link given in point 1,
highlighted in red.

2.​ A new page will open up as shown below. Type a password, re-enter it, and click Submit. A password would
be setup for your account. Use it to login.
3.​ Now, navigate to https://robin.bodhi.cse.iitb.ac.in/ and click Login/Signup blue color button in the top
right corner. Write your LDAP ID (small letters) and the newly created password and click Sign In.

4.​ You will be redirected to ‘My Dashboard’, where you can see the course you have been enrolled in. Click on
CS101S24: Computer Programming ….

5.​ You will see a page similar to the one given below. Multimedia book is where you will see the lab material.
Click on Lab 0: Links
6.​ You will see a page similar to the one given below. Open up the Lab0 - Google Docs link and follow the
instructions. This is the same docs link. Click on the Labs tab. All weekly labs and lab exams will be listed
here.

7.​ You will see the lab for today. Click on the ‘Lab 01: Introduction’.

8.​ You will see the list of programming questions under ‘Lab Activities’ tab.
9.​ Click on Lab Details tab to view more / general information about the lab. We will provide extra links or
some information like how many questions are compulsory/opitonal, etc. You can also view the deadline to
submit the questions in the lab.

10.​Click on Lab Activities again. Click on the question you want to attempt. An example given below shows
Q3: Add two numbers. In the left pane, there is an area to write your program, and on the right, you will see
the problem statement and some practice/visible test cases.

11.​You can either write your code and click on the Submit Code button or choose an existing file from your
computer and click the ‘Upload’ button. Note that while using the upload feature, make sure that the
filename is the same as mentioned.
12.​Click the blue color button under Practice marks. This will run your code for the practice test cases. To view
detailed information about which test cases passed/failed, click ‘Run visible testcases’. You will get to see for
each input what output was produced by your code and what was expected.

13.​Submit your code for all the questions. Solutions are on the next page and are shared for only this week.
Lab 0 Solutions

​ ​ Q1) Square
#include<simplecpp>
main_program {
turtleSim();
repeat(4) {
forward(100);
left(90);
}
wait(5);
}

​ ​ Q2) Helloworld
#include<simplecpp>
main_program {
cout << “helloworld”;
}

​ ​ Q3) Add two numbers


#include<simplecpp>
main_program {
int num1, num2, add;
​ add = num1 + num2;
cout << add;
}

😀
~~~ That’s it for today’s lab. See you all next week ~~~

~~~ Happy coding and All the best ~~~

You might also like