SlideShare a Scribd company logo
1 of 2
Download to read offline
Programming Exercises:
a) Given a struct called Computer with following data members:
struct Computer
{
int RAM;
float speed;
int hardDrive;
int Cache;
string processor;
};
Declare an object called myLaptop of type Computer with the following initialization for
myLaptop
RAM = 8 GB
Speed = 2.4 GHz
hardDrive = 500 GB
Cache = 32 KB
Processor = I5 Intel
b) Write down the definition of a class called Fraction which has two private data members:
numerator and denominator both of type integer
The class also has public functions:
i) A constructor function that can be used to construct a fraction with users own chosen values of
numerator and denominator
ii) A void function PrintFraction that will display the fraction
iii) A value return function FracValue that will return the value of numerator divided by
denominator (which is a floating point number)
C). Define a struct FruitType to store the following data about a fruit: fruit name (string), color
(string), fat (int), sugar (int), and carbohydrate (int).
d). Given a class called Book which has four private members: title (string), author (string), price
(float or double) and noOfCopies (an integer).
Define a constructor function that will assign the values of title, author, price and noOfCopies
values from users chosen parameters, say title1, author1, price1, copies1
e) Declare an array of floating point number to store gpa of 10 students. Now write a loop to
input the values of this gpa from computers keyboard.

More Related Content

Similar to Programming Exercises- a) Given a struct called Computer with followin.pdf

Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxjosephineboon366
 
Pune University MCA [Management] 2020-Sample Questions
Pune University MCA [Management] 2020-Sample QuestionsPune University MCA [Management] 2020-Sample Questions
Pune University MCA [Management] 2020-Sample Questionsshailendrashinde9
 
Bt0062 fundamentals of it model question paper
Bt0062 fundamentals of it model question paperBt0062 fundamentals of it model question paper
Bt0062 fundamentals of it model question paperAnimish Puttu
 
do it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxdo it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxjameywaughj
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperMalathi Senthil
 
The reasons why 64-bit programs require more stack memory
The reasons why 64-bit programs require more stack memoryThe reasons why 64-bit programs require more stack memory
The reasons why 64-bit programs require more stack memoryPVS-Studio
 
Boost.Python: C++ and Python Integration
Boost.Python: C++ and Python IntegrationBoost.Python: C++ and Python Integration
Boost.Python: C++ and Python IntegrationGlobalLogic Ukraine
 
A nice 64-bit error in C
A  nice 64-bit error in CA  nice 64-bit error in C
A nice 64-bit error in CPVS-Studio
 
Linux training in Chandigarh
Linux training in ChandigarhLinux training in Chandigarh
Linux training in Chandigarhashish34a
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Poonam Chopra
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercisesNico Ludwig
 

Similar to Programming Exercises- a) Given a struct called Computer with followin.pdf (20)

Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docx
 
Pune University MCA [Management] 2020-Sample Questions
Pune University MCA [Management] 2020-Sample QuestionsPune University MCA [Management] 2020-Sample Questions
Pune University MCA [Management] 2020-Sample Questions
 
Bt0062 fundamentals of it model question paper
Bt0062 fundamentals of it model question paperBt0062 fundamentals of it model question paper
Bt0062 fundamentals of it model question paper
 
do it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxdo it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docx
 
Clanguage
ClanguageClanguage
Clanguage
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question Paper
 
Final assignments
Final assignmentsFinal assignments
Final assignments
 
Why learn Internals?
Why learn Internals?Why learn Internals?
Why learn Internals?
 
The reasons why 64-bit programs require more stack memory
The reasons why 64-bit programs require more stack memoryThe reasons why 64-bit programs require more stack memory
The reasons why 64-bit programs require more stack memory
 
Boost.Python: C++ and Python Integration
Boost.Python: C++ and Python IntegrationBoost.Python: C++ and Python Integration
Boost.Python: C++ and Python Integration
 
C programming unit 01
C programming unit 01C programming unit 01
C programming unit 01
 
PyCon Estonia 2019
PyCon Estonia 2019PyCon Estonia 2019
PyCon Estonia 2019
 
A nice 64-bit error in C
A  nice 64-bit error in CA  nice 64-bit error in C
A nice 64-bit error in C
 
Linux training in Chandigarh
Linux training in ChandigarhLinux training in Chandigarh
Linux training in Chandigarh
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015
 
Coa
Coa Coa
Coa
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises
 
Express 070 536
Express 070 536Express 070 536
Express 070 536
 

More from arbtimescentre

Provide a detail justification for the organizational chart above Auta.pdf
Provide a detail justification for the organizational chart above Auta.pdfProvide a detail justification for the organizational chart above Auta.pdf
Provide a detail justification for the organizational chart above Auta.pdfarbtimescentre
 
Prove that n24O(n3).pdf
Prove that n24O(n3).pdfProve that n24O(n3).pdf
Prove that n24O(n3).pdfarbtimescentre
 
Prove that L(NFA) is countable- (1).pdf
Prove that L(NFA) is countable- (1).pdfProve that L(NFA) is countable- (1).pdf
Prove that L(NFA) is countable- (1).pdfarbtimescentre
 
Protons (H+)accumulate in the thylakoid space during electron transpor.pdf
Protons (H+)accumulate in the thylakoid space during electron transpor.pdfProtons (H+)accumulate in the thylakoid space during electron transpor.pdf
Protons (H+)accumulate in the thylakoid space during electron transpor.pdfarbtimescentre
 
Proteins perform many important roles in the life of an organism- All.pdf
Proteins perform many important roles in the life of an organism- All.pdfProteins perform many important roles in the life of an organism- All.pdf
Proteins perform many important roles in the life of an organism- All.pdfarbtimescentre
 
Prove by induction that 8n1 is divisible by 7 for all integers n1-.pdf
Prove by induction that 8n1 is divisible by 7 for all integers n1-.pdfProve by induction that 8n1 is divisible by 7 for all integers n1-.pdf
Prove by induction that 8n1 is divisible by 7 for all integers n1-.pdfarbtimescentre
 
Proparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdf
Proparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdfProparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdf
Proparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdfarbtimescentre
 
Prompts This case study introduces you to what a volcanologist does an.pdf
Prompts This case study introduces you to what a volcanologist does an.pdfPrompts This case study introduces you to what a volcanologist does an.pdf
Prompts This case study introduces you to what a volcanologist does an.pdfarbtimescentre
 
PROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdf
PROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdfPROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdf
PROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdfarbtimescentre
 
Prokaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdf
Prokaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdfProkaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdf
Prokaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdfarbtimescentre
 
Project 6- Design and implement a concordance program- that stores a l.pdf
Project 6- Design and implement a concordance program- that stores a l.pdfProject 6- Design and implement a concordance program- that stores a l.pdf
Project 6- Design and implement a concordance program- that stores a l.pdfarbtimescentre
 
Project 2- Generate a computerized telephone directory for a cellular.pdf
Project 2- Generate a computerized telephone directory for a cellular.pdfProject 2- Generate a computerized telephone directory for a cellular.pdf
Project 2- Generate a computerized telephone directory for a cellular.pdfarbtimescentre
 
Program Coding (C Programming) for Turning Machine 1) Write coding in.pdf
Program Coding (C Programming) for Turning Machine 1) Write coding in.pdfProgram Coding (C Programming) for Turning Machine 1) Write coding in.pdf
Program Coding (C Programming) for Turning Machine 1) Write coding in.pdfarbtimescentre
 
Profilo Co- has the following assets and liabilities- Assets- cash- $1.pdf
Profilo Co- has the following assets and liabilities- Assets- cash- $1.pdfProfilo Co- has the following assets and liabilities- Assets- cash- $1.pdf
Profilo Co- has the following assets and liabilities- Assets- cash- $1.pdfarbtimescentre
 
Process Name- International Student Admission Process(George Brown Col.pdf
Process Name- International Student Admission Process(George Brown Col.pdfProcess Name- International Student Admission Process(George Brown Col.pdf
Process Name- International Student Admission Process(George Brown Col.pdfarbtimescentre
 
Problems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdf
Problems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdfProblems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdf
Problems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdfarbtimescentre
 
Process capability Part 2 A-exists when CPK is less than 1-0- B- m.pdf
Process capability Part 2   A-exists when CPK is less than 1-0-   B- m.pdfProcess capability Part 2   A-exists when CPK is less than 1-0-   B- m.pdf
Process capability Part 2 A-exists when CPK is less than 1-0- B- m.pdfarbtimescentre
 
Problems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdf
Problems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdfProblems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdf
Problems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdfarbtimescentre
 
Problems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdf
Problems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdfProblems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdf
Problems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdfarbtimescentre
 
Problem 7) The number of buses that arrive at a bus stop in T minutes.pdf
Problem 7) The number of buses that arrive at a bus stop in T minutes.pdfProblem 7) The number of buses that arrive at a bus stop in T minutes.pdf
Problem 7) The number of buses that arrive at a bus stop in T minutes.pdfarbtimescentre
 

More from arbtimescentre (20)

Provide a detail justification for the organizational chart above Auta.pdf
Provide a detail justification for the organizational chart above Auta.pdfProvide a detail justification for the organizational chart above Auta.pdf
Provide a detail justification for the organizational chart above Auta.pdf
 
Prove that n24O(n3).pdf
Prove that n24O(n3).pdfProve that n24O(n3).pdf
Prove that n24O(n3).pdf
 
Prove that L(NFA) is countable- (1).pdf
Prove that L(NFA) is countable- (1).pdfProve that L(NFA) is countable- (1).pdf
Prove that L(NFA) is countable- (1).pdf
 
Protons (H+)accumulate in the thylakoid space during electron transpor.pdf
Protons (H+)accumulate in the thylakoid space during electron transpor.pdfProtons (H+)accumulate in the thylakoid space during electron transpor.pdf
Protons (H+)accumulate in the thylakoid space during electron transpor.pdf
 
Proteins perform many important roles in the life of an organism- All.pdf
Proteins perform many important roles in the life of an organism- All.pdfProteins perform many important roles in the life of an organism- All.pdf
Proteins perform many important roles in the life of an organism- All.pdf
 
Prove by induction that 8n1 is divisible by 7 for all integers n1-.pdf
Prove by induction that 8n1 is divisible by 7 for all integers n1-.pdfProve by induction that 8n1 is divisible by 7 for all integers n1-.pdf
Prove by induction that 8n1 is divisible by 7 for all integers n1-.pdf
 
Proparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdf
Proparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdfProparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdf
Proparty initimanos Prertate Ausa West offict- PAArA 3 3o-bed hopase t.pdf
 
Prompts This case study introduces you to what a volcanologist does an.pdf
Prompts This case study introduces you to what a volcanologist does an.pdfPrompts This case study introduces you to what a volcanologist does an.pdf
Prompts This case study introduces you to what a volcanologist does an.pdf
 
PROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdf
PROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdfPROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdf
PROMPT (to be written in C)- This exercise has 2 parts- In each case y.pdf
 
Prokaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdf
Prokaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdfProkaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdf
Prokaryotes use a single type of RNA polymerase to transcribe mRNA- tR.pdf
 
Project 6- Design and implement a concordance program- that stores a l.pdf
Project 6- Design and implement a concordance program- that stores a l.pdfProject 6- Design and implement a concordance program- that stores a l.pdf
Project 6- Design and implement a concordance program- that stores a l.pdf
 
Project 2- Generate a computerized telephone directory for a cellular.pdf
Project 2- Generate a computerized telephone directory for a cellular.pdfProject 2- Generate a computerized telephone directory for a cellular.pdf
Project 2- Generate a computerized telephone directory for a cellular.pdf
 
Program Coding (C Programming) for Turning Machine 1) Write coding in.pdf
Program Coding (C Programming) for Turning Machine 1) Write coding in.pdfProgram Coding (C Programming) for Turning Machine 1) Write coding in.pdf
Program Coding (C Programming) for Turning Machine 1) Write coding in.pdf
 
Profilo Co- has the following assets and liabilities- Assets- cash- $1.pdf
Profilo Co- has the following assets and liabilities- Assets- cash- $1.pdfProfilo Co- has the following assets and liabilities- Assets- cash- $1.pdf
Profilo Co- has the following assets and liabilities- Assets- cash- $1.pdf
 
Process Name- International Student Admission Process(George Brown Col.pdf
Process Name- International Student Admission Process(George Brown Col.pdfProcess Name- International Student Admission Process(George Brown Col.pdf
Process Name- International Student Admission Process(George Brown Col.pdf
 
Problems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdf
Problems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdfProblems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdf
Problems 1 and 2 Suppose that Alice's public RSA key and scheme is giv.pdf
 
Process capability Part 2 A-exists when CPK is less than 1-0- B- m.pdf
Process capability Part 2   A-exists when CPK is less than 1-0-   B- m.pdfProcess capability Part 2   A-exists when CPK is less than 1-0-   B- m.pdf
Process capability Part 2 A-exists when CPK is less than 1-0- B- m.pdf
 
Problems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdf
Problems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdfProblems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdf
Problems 7 and 8 Let X be a discrete random variable on {0-1}- Find th.pdf
 
Problems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdf
Problems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdfProblems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdf
Problems (1 pt) PUT GENOTYPES HERE Having dimples is a dominant trait.pdf
 
Problem 7) The number of buses that arrive at a bus stop in T minutes.pdf
Problem 7) The number of buses that arrive at a bus stop in T minutes.pdfProblem 7) The number of buses that arrive at a bus stop in T minutes.pdf
Problem 7) The number of buses that arrive at a bus stop in T minutes.pdf
 

Recently uploaded

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Recently uploaded (20)

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Programming Exercises- a) Given a struct called Computer with followin.pdf

  • 1. Programming Exercises: a) Given a struct called Computer with following data members: struct Computer { int RAM; float speed; int hardDrive; int Cache; string processor; }; Declare an object called myLaptop of type Computer with the following initialization for myLaptop RAM = 8 GB Speed = 2.4 GHz hardDrive = 500 GB Cache = 32 KB Processor = I5 Intel b) Write down the definition of a class called Fraction which has two private data members: numerator and denominator both of type integer The class also has public functions: i) A constructor function that can be used to construct a fraction with users own chosen values of numerator and denominator ii) A void function PrintFraction that will display the fraction iii) A value return function FracValue that will return the value of numerator divided by denominator (which is a floating point number)
  • 2. C). Define a struct FruitType to store the following data about a fruit: fruit name (string), color (string), fat (int), sugar (int), and carbohydrate (int). d). Given a class called Book which has four private members: title (string), author (string), price (float or double) and noOfCopies (an integer). Define a constructor function that will assign the values of title, author, price and noOfCopies values from users chosen parameters, say title1, author1, price1, copies1 e) Declare an array of floating point number to store gpa of 10 students. Now write a loop to input the values of this gpa from computers keyboard.