google.com, pub-3534375712831849, DIRECT, f08c47fec0942fa0 CS101 Assignment 2 Solution Fall 2021 Download in PDF
Latest Updates
Loading...

CS101 Assignment 2 Solution Fall 2021 Download in PDF




Q. 1. Write the HTML code to make a webpage as depicted in the following diagram (Sample output).

Sample Output:


Solution:
<html>
<head>
<title>bc21040333333</title>
</head>
<body>
<a href="https://www.vu.edu.pk/">
<img  src="https://www.vu.edu.pk/App_Themes/Default/Images/menu-img/logo.png" ></a>
<h2 style="clear: both; text-align: left;"><b>Grade Detail</b></h2>
<div style="text-align: left;"><b>Intermediate</b></div>
<div style="text-align: left;">Obtained Marks: 2386</div>
<div style="text-align: left;"><i>Percentage:</i> 68%</div>
<div style="text-align: left;"><i>Grade:</i> B</div>
<h3 style="text-align: left;"><b>Currently Enrolled Course</b></h3>
<div style="text-align: left;">
<ul style="text-align: left;">
<li>CS101</li>
<li>ENG101</li>
<li>ISL202</li>
<li>MTH101</li>
<li>PAK301</li>
<li>PHY101</li>
<li>VU001</li>
</ul>


<div>Contact info: bc210400000@vu.edu.pk</div>
</div>
<div style="text-align: left;"><b><br></b></div>
<div class="separator" style="clear: both; text-align: left;"><br></div>

</body>

Q.2. Suppose a refreshment center is offering the following 8 flavors of juices and shakes.

 

Sr. No.

Juice

0

Pena Colada

1

Strawberry

2

Pineapple

3

Mango

4

Orange

5

Cookies and cream Milk shake

6

Coffee Milkshake

7

Candy Flavor Milkshake

 

The availability of these 8 flavors can be represented in the form of an 8-bit status string e.g. “11111111” where each bit “1” from left to right represents the availability of each flavor in the table from top to bottom respectively. The left-most bit represents the availability status of Pena Colada and the right-most bit represents the availability of Candy Flavor Milkshake.  In the status string, “1” means the flavor is available and the unavailability of a flavor will be represented by “0” at the respective bit position.

 

Considering the above scenario, perform the following operations:

 

A.    Assuming that all the flavors were available in the morning. If the juices at serial no. 3 and 5 in the table are finished at 2:00 PM, compute the new status string by using the appropriate logical operation.

           

B.     If the availability status string of juices and shakes is “10101001” at 4:00 PM, check the availability of the “Coffee Milk Shake” using the appropriate logical operation:

 

Solution:

Sr. No

0

1

2

3

4

5

6

7

Juice

Pena Colada

Strawberry

Pineapple

Mango

Orange

Cookies and cream Milk shake

Coffee Milkshake

Candy Flavor Milkshake

Morning Status

1

1

1

1

1

1

1

1

Status After 2 PM

1

1

1

0

1

0

1

1

Status After 2 PM (AND Operation)

1

1

1

0

1

0

1

1

Status at 4 PM

1

0

1

0

1

0

0

1

Final Status

1

0

1

0

1

0

0

1

 

Coffee Milkshake is not available


Download CS101 Assignment 2 Solution in PDF Free




Want more info, please press the below button




`

Post a Comment

0 Comments