Computer Programming Lab.

Added on - 28 Jul 2021

  • 10

    Pages

  • 541

    Words

  • 699

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 3 of 10 pages
Computer Programming Lab
spring 2021
Submitted by:ADNAN AYAZ
Registration No.:20PWCSE1860
Class Section:A
“On my honor, as student of University of Engineering and Technology, I have neither given
nor received unauthorized assistance on this academic work.”
Student Signature: ______________
Submitted to:
SIR ABDULLAH HAMID
JULY 25, 2021
Department of Computer Systems Engineering
University of Engineering and Technology, Peshawar
Lab 10 &;11: Structures and Classes
Objectives:
To learn about data structures and classes in C++
Tasks:
Task 1:1.1. A phone number such is (091) 767-8900 can be thought of as having three parts: the area
code (091), exchange (767) and number 8900. Write a program that uses structure to
store these 3 parts of a phone number separately. Assume name of the structure is
‘phone’. Create two objects of type ‘phone’, initialize one object and take the other one
from the user. Display both numbers.
Sample Run:
Enter you Area code, exchange, and number: 091 767 8900
My number is (042) 867-4982
Your number is (091) 767-8900
CODING:
OUTPUT:
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document