rss
twitter
    Find out what You Want :)
Home    Downloads    Corner    Market    News sites    About Us

Sunday, April 17

Cs201 Assignment# 1 Solution

CS 2O1 Introduction To Programming
Assignment# 1 Solution
Semester Spring 2011


#include<iostream.h>
int amount(char, int);
main()
{
      int days;
      int rent;
      char model;
      char name[20];
      char carNo[10];
      cout << "Please provide cumstomer Name\t";
      cin >> name;
     
      cout << "\nPlease provide Car Model Description" << endl << endl;
      cout << "\tEnter 'A' for Model 2009.\n";
      cout << "\tEnter 'B' for Model 2010.\n";
      cout << "\tEnter 'C' for Model 2011.\n";
      cin >> model;
     
      cout << "\nplease provide following information:" << endl << endl;
      cout << "Car No:\t\t";
      cin >> carNo;
     
      cout << "Number of days\t";
      cin >> days;
      cout << endl << endl;
     
      switch(model)
      {
           case 'A':
           case 'a':
                      cout << "Customer Name:\t" << name << endl;
                      cout << "Car Model:\t2009" << endl;
                      cout << "Car No:\t\t" << carNo << endl;
                      cout << "Number of days:\t" << days << endl;
                      rent = amount(model, days);
                      cout << "Your Rental Amaount is:\t" << rent << endl;
           break;
           case 'B':
           case 'b':
                      cout << "Customer Name:\t" << name << endl;
                      cout << "Car Model:\t2010" << endl;
                      cout << "Car No:\t\t" << carNo << endl;
                      cout << "Number of days:\t" << days << endl;
                      rent = amount(model, days);
                      cout << "Your Rental Amaount is:\t" << rent << endl;
           break;
          
           case 'C':
           case 'c':
                      cout << "Customer Name:\t" << name << endl;
                      cout << "Car Model:\t2011" << endl;
                      cout << "Car No:\t\t" << carNo << endl;
                      cout << "Number of days:\t" << days << endl;
                      rent = amount(model, days);
                      cout << "Your Rental Amaount is:\t" << rent << endl;
           break;
          
           default:
                   cout << "please select only 2009, 2010, 2011 car models";
          
           }
      system("pause");
      }
    
int amount(char m, int d){
    if(m == 'A' || m == 'a')
    return (5000 * d);
   
    else if(m == 'B' || m == 'b')
    return (8000 * d);
       
    else if(m == 'C' || m == 'c')
    return (10000 * d);
    } 

CS 302 Assignment# 1 Solution

CS302: Digital Logic Design
Assignment No. 01
Semester: Spring 2011


1.Convert 10101100 binary numbers to its decimal equivalent.172 (2 Marks)

=0*20 + 0*21+1*22+1*23+0*24+1*25+0*26+1*27
=    1      2       4        8       16      32     64     128
=0*1 + 0*2  +1*4  +1*8 +0*16 +1*32 +0*64 +1*128
=0+0+4+8+0+32+0+128
=172

2. Convert  decimal  number  374  to Octal number. (2 Marks)
 
Answer: 566


 
8
374
8
46
6

5
6

 
 






3. Convert the following 0110100000111001 (BCD) in to decimal number. (2 Marks)


0110  1000   0011   1001   convert into 4-bit code
6          8          3          9      decimal numbers according to BCD


Answer:   6839


 
4.Convert B2A16 to Octal5452 (2 Marks)
In hex system B = 11 and A = 10
Therefore
= 11*162 + 2*161  +  10*160
= 2816+32+10
=2858 decimal

Now in octal number
Answer : 5452 octal

8
2858
8
357
2
8
44
5

5
4

 





5.Convert decimal number 3085 to hex   (2 Marks)
A= 10
B= 11
C= 12
D= 13
E= 14
F= 15

Answer: C0D
 
16
3085

16
192
13

12
0

ISL 201 Assignment# 1 Solution

Islamic Studies (ISL201)
 Assignment# 1 Solution
Semester “Spring 2011

Faith” idea solution

The Holy Quran has clearly designated the Holy Prophet (PBUH)
as the teacher, purifier, legislator and model of human conduct and
all these designations have been bestowed by Allah. Being a
Muslim you have to describe in detail the basis of our relation with
the Holy Prophet Muhammad (Peace be upon him)?
Answer:
To be dynamically effective, one’s life should function as an integrated whole
system conforming to Allah’s Law. As such, everything in man (his physical,
economic, political, socio-cultural, psychological, educational, moral and spiritual
being) needs proper guidance. Such guidance should enable him to enjoy better
life here and in the hereafter. It should enable him to spend wisely his temporary
journey on earth for everlasting happiness in the eternal world hereafter
Man who lives in accordance to the teachings of Prophet Muhammad (s.a.w.s.)
finds internal and external peace. He can easily establish harmony with his
immediate environment (with his family, relatives, neighbors and friends) and
those outside his community
 
Sayings of Holy Prophet (S.A.W.W) As teacher :
1) Holy Prophet (S.A.W.W) said ” I have been sent as a teacher”.
2) ” Getting Education is an obligation for both man and women”.
3) ” Seek knowledge from your birth to your grave”.
4) “Achieve knowledge, even if you have to go to China”.
You always used to pray ” O’Allah , Increase my knowledge”.
 
Saying of Holy Profit (S.A.W.W) as Purifier:
A man once said to the Prophet Muhammad (PBUH) : " I have plenty of property,
a large family, a great deal of money, and I am a gracious host to my guests. Tell
me how to conduct my life and how to spend (my money)." The Prophet (PBUH)
replied : " Give (regular charity) out of your property, for truly it is a purifier, and
be kind to your relatives and acknowledge the rights of the poor, neighbors and
(those in need who seek your help) " Fiqh-us-Sunnah, Volume 3, Number 3
 
Holy Prophet (S.A.W.W) as legislator: 
Thus in addition to the Holy Quran, God's legislative guidance has been revealed
in the Holy Prophet (PBUH)sunnah, i.e. his saying and conducts.
Here, the Holy Prophet (PBUH)duty entrusted to him by God is execution of
rules and establishment of a State. In other words, the Holy Prophet (PBUH)has
authority here. This is not only a right, but also an obligation entrusted to the
Holy Prophet (PBUH)by God. For example, in the Holy Quran, God commands
the Holy Prophet(PBUH): “thou mayst judge between mankind by that which
Allah showeth thee” (4:105).

Discus Your Study Problems Here

Is This Blog Is Useful For You?

Face Book Fans