CS201 GDB solution
Page 1 of 1 • Share
CS201 GDB solution
Topic:-
Structures and Classes are very important data structures used in C / C++. You as a programmer has a choice to use any of them
as Structures and Classes do provide features some what similar but only with some differences. Now you are given a task
to code either using Structures or Classes.
Please give your justification in favor or against of any one you will use for coding.
SOLUTION:
Use classes in coding due to the following characteristics.
Structures has only data variables gathered, grouped and named as a single entity, but in classes there are both data members and as well as functions to manipulate data members.
In structures data variables are by default public and are visible to all and every one can change them. But the data members and member functions are by default are private and are not visible to every one. In classed we can make the member functions public to manipulate the data members so these are visible to every one and by making data members private we can hide them. So one cannot change the values wrongly.
Structures and Classes are very important data structures used in C / C++. You as a programmer has a choice to use any of them
as Structures and Classes do provide features some what similar but only with some differences. Now you are given a task
to code either using Structures or Classes.
Please give your justification in favor or against of any one you will use for coding.
SOLUTION:
Use classes in coding due to the following characteristics.
Structures has only data variables gathered, grouped and named as a single entity, but in classes there are both data members and as well as functions to manipulate data members.
In structures data variables are by default public and are visible to all and every one can change them. But the data members and member functions are by default are private and are not visible to every one. In classed we can make the member functions public to manipulate the data members so these are visible to every one and by making data members private we can hide them. So one cannot change the values wrongly.
Rao Muhammad Aftab- Monstars
-
Posts : 1091
Join date : 2011-02-11
Age : 35
Re: CS201 GDB solution
nice 4 share[You must be registered and logged in to see this image.]
Shiza Haqqani- Monstars
-
Posts : 156
Join date : 2011-05-23
Age : 34
Location : net
Similar topics
» CS201 Assignment No.2 Solution
» CS201 Assignment No. 3
» CS201 Assignment No. 4
» CS504 GDB solution
» FIN630 GDB Solution
» CS201 Assignment No. 3
» CS201 Assignment No. 4
» CS504 GDB solution
» FIN630 GDB Solution
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Yesterday at 12:21 pm by ali001
» Hemangiom'App
Tue Nov 05, 2024 11:25 am by ali001
» MindfulMe - Mental Health App
Mon Nov 04, 2024 10:50 am by ali001
» Learn Candlestick Patterns
Tue Oct 15, 2024 5:51 am by ali001
» Woh Pagal Si Episode 52 to 62 - Top Pakistani Drama
Sat Sep 21, 2024 6:26 pm by Mir Emmad Ali Khan Domki
» Nearu - share your socials
Sat Sep 21, 2024 1:12 pm by ali001
» Nightclub Tycoon: Idle Empire
Thu Sep 19, 2024 9:16 pm by ali001
» Carnivore - Meat Diet Recipes
Wed Sep 18, 2024 2:37 pm by ali001
» Eid Milad un Nabi Mubarak 2024 (Rabiʻ I 14, 1446 AH)
Tue Sep 17, 2024 3:44 pm by Mir Emmad Ali Khan Domki