BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

Register FAQ Community Calendar New Posts Navbar Right Corner
HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 3rd Semester > Object Oriented Programming

Object Oriented Programming By Mam Sidra Malik


Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1  
Old 04-09-2008, 11:06 PM
.BZU.'s Avatar


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Heart Assignment} Exercise#4 Question 9 and 11

Chapter # 4: Exercise Pages# 159 Question Number 9
Book
Object Oriented Programming by Robert Lafore
Code:
#include <iostream>
using namespace std;

struct time  // a strcuture time defined 
    {
    int hours;  // hours in time
    int minutes;  // minutes in time 
    int seconds;  // seconds in time
    };
int main()
{
    int totalsecs;
    time var_time;
    cout<<"Please enter the hours = ";
    cin>>var_time.hours;
    cout<<"Please enter the mintues = ";
    cin>>var_time.minutes;
    cout<<"Please enter the seconds = ";
    cin>>var_time.seconds;
    
    totalsecs = var_time.hours*3600+var_time.minutes*60+var_time.seconds;
    cout<<"total sconds of the given time are calculated as = "<<totalsecs<<endl;
return 0;
}

Here is the result:


__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote
  #2  
Old 05-09-2008, 12:26 AM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Re: Assignment} Exercise#4 Question 9 and 11

Solution of Question # 11

Code:
#include <iostream>
using namespace std;

struct time
{
    int hours,minutes,seconds;

};


int main()


{
    time time1,time2,time3;
    int temp;
    char colon;

    cout<<"enter First time in this format (12:30:30):";
    cin>>time1.hours>>colon>>time1.minutes>>colon>>time1.seconds;

    cout<<"enter Second time in this format (12:30:30):";
    cin>>time2.hours>>colon>>time2.minutes>>colon>>time2.seconds;

    long totalseconds1=time1.hours*3600 + time1.minutes*60 + time1.seconds;

    long totalseconds2=time2.hours*3600 + time2.minutes*60 + time2.seconds;

    long totalseconds=totalseconds1+totalseconds2;

    time3.hours=totalseconds/3600;

    temp=totalseconds%3600;

    time3.minutes=temp/60;

    time3.seconds=temp%60;


    cout<<"\nTotal Time: "<<time3.hours<<":"<<time3.minutes<<":"<<time3.seconds<<endl;

    return 0;

}

Reply With Quote
  #3  
Old 18-12-2008, 01:47 PM
sohail's Avatar
Little Baby

 
Join Date: Oct 2008
Location: Lahore
Age: 36
Posts: 9
Contact Number: 03224502156
Program / Discipline: BSCS
Class Roll Number: 8229
sohail is on a distinguished road
Software Re: assignemt of cmplexnumbers

yar I am student of 3rd semester in bscs kindly help me in my mid term project of oop
the progamme is for complex numbers that perform multipilacation ,division, addition ,substraction i am wating yuor reply i submit my programm at 20 december ok ...............
Reply With Quote
Reply

Tags
assignment, c++, exercise#4, question


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pathan Exercise thecool Funny/Comedy 0 30-08-2010 08:29 AM
Brain Exercise usman_latif_ch Chit Chat 0 11-04-2009 07:55 AM
Assignment Questions from Exercise:6 .BZU. Object Oriented Programming 5 25-09-2008 03:42 PM
Exercise of Chapter # 7 .BZU. Web Development 3 02-12-2007 02:22 PM
Assignment#4 Model for webdevelopment assignment .BZU. Web Development 2 18-11-2007 06:49 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 10:48 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.