Design a class that holds the following personal data: name, age, and phone number. Write appropriate accessor and mutator functions. Demonstrate the class by writing a program that creates three instances of it. One instance should hold your information, and the other two should hold your friend's or family member's information.

Answers

Answer 1

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

class MyClass {

 public:      

   string name;

   int age;  

   int phone;};

int main() {

   MyClass me;  

   me.name = "MrRoyal";

   me.age = 10;

   me.phone = 12345;

   MyClass frnd;  

   frnd.name = "Friend";

   frnd.age = 12;

   frnd.phone = 34567;

   MyClass family;  

   family.name = "Family";

   family.age = 15;

   family.phone = 10111;

   cout << me.name << " " << me.age<<" "<<me.phone<<endl;

   cout << frnd.name << " " << frnd.age<<" "<<frnd.phone<<endl;

   cout << family.name << " " << family.age<<" "<<family.phone<<endl;  

 return 0;}

Explanation:

This defines the class

class MyClass {

The access specifier

 public:      

The next three lines are the attributes of the class

   string name;

   int age;  

   int phone;};

The main begins here

int main() {

This creates the class instance for me (you)

   MyClass me;  

This sets the name

   me.name = "MrRoyal";

This sets the age

   me.age = 10;

This sets the phone number

   me.phone = 12345;

This creates the class instance for your friend

   MyClass frnd;  

This sets the name

   frnd.name = "Friend";

This sets the age

   frnd.age = 12;

This sets the phone number

   frnd.phone = 34567;

This creates the class instance for a family member

   MyClass family;  

This sets the name

   family.name = "Family";

This sets the age

   family.age = 15;

This sets the phone number

   family.phone = 10111;

These print the necessary outputs

   cout << me.name << " " << me.age<<" "<<me.phone<<endl;

   cout << frnd.name << " " << frnd.age<<" "<<frnd.phone<<endl;

   cout << family.name << " " << family.age<<" "<<family.phone<<endl;  

 return 0;}


Related Questions

State whether the following statements are true or false:
 a) General purpose computers can carry out only a specific task. 
b) An analog computer is the special purpose computer.
 c) Analog computers work on binary digits. 
d) Digital computer works on digital data. 
e) Microcomputer is most powerful and fastest computer. 
f) Minicomputers are also multi user computers.
 g) Hybrid computers have the features of both analog and digital computers. ​

Answers

a) false
b) false
c) true
d) false
e)true
F) true

Ms. Osteen gives her class an assignment to insert background color that gradually changes from blue to green. To accomplish this design
effect the students must add a:
O A. swatch.
OB. fill.
C. gradient.
D. pattern.
Need help

Answers

Answer:

C

Explanation:

in 2 or 3 sentences, describe one advanced stradegy and how its useful

Answers

Answer:

A search strategy is useful because it helps you learn about things that are not available to you in person. One advanced search strategy is to form words carefully. I could copy 'describe one advance search strategy and how it is useful' and put it into a search engine and get many different results that aren't helpful. But if I shorten it to 'advance search strategies' I get helpful information.

Explanation:

Need the answer ASAP !!!!

Select the correct answer.
What stage of software development incorporates planning to help make changes in the project plan based on reviews?
OA.
project startup
OB.
proposal stage
OC.
periodic checks
OD.
product delivery

Answers

Answer:

periodic checks

Explanation:

Which act passed by the US government in 1998 criminalizes the production and distribution of technology that intends to evade anti-piracy laws?

A.
Stop Online Piracy Act (SOPA)
B.
Digital Millennium Copyright Act (DMCA)
C.
Preventing Real Online Threats to Economic Creativity and Theft of Intellectual Property Act (PROTECT IP or PIPA)
D.
World Intellectual Property Organization (WIPO) Copyright Treaty

Answers

Answer:

B

Explanation:

Based on the following quote from Leonardo Da Vinci, what would be his definition of a fine artist? “Principles for the Development of a Complete Mind: Study the science of art. Study the art of science. Develop your senses- especially learn how to see. Realize that everything connects to everything else.” - Leonardo da Vinci
A fine artist must discover the world for herself and not listen to others’ interpretations.

A fine artist is one who sees things others don’t see and makes connections others don’t make.

A fine artist is a scientific genius who cultivates the power of observation.

A fine artist must first be scientist and use science to improve his art.

Please hurry :(

Answers

Answer:

A fine artist is one who sees the things other don't see and make connections other don't make.

Answer:

I think it is

A fine artist is one who sees things others don’t see and makes connections others don’t make.

Which of the following statements tests if users walked 10,000 or more steps and ate fewer than 25 grams of sugar?
A. if(steps >= 10,000 and sugar > 25);
B. if(steps >= 10,000 or sugar < 25):
C. if(steps >= 10,000 and sugar < 25):
D. if(steps > 10,000 or sugar < 25):

Answers

Answer:

C. if(steps >= 10,000 and sugar < 25):

Explanation:

This is a combined statement, where by two different conditions are being evaluated. The statement only returns TRUE; if each of the two conditions are TRUE.

The sign '>=' means greater than or equal in computer programming.

Hence, steps >= 10000 (step is 10000 or more)

< less than

Sugar < 25 (sugar is below of fewer Than 25)

and : requires that the two conditions comes up true for any data passed in.

Answer:

C. if(steps >= 10,000 and sugar < 25):

Explanation:

This makes it so the if statement not only needs to have both sides of the and statement true, but has both sides correct, as the user walked exactly or more then 10,000 steps, and has eaten more than 25 grams, not exactly 25 grams of sugar.

What is the home page on a website?

A.
a video streaming page where the content plays
B.
the opening page of the website
C.
the page with contact details
D.
the page where you can log in
E.
an organization's page listing job openings

Answers

Answer: The answer is (D)....

HOPE THIS HELPS YOU, HAVE A NICE DAY....

Explanation:

Why would a designer choose to use a static layout? Check all of the boxes that apply.

It helps to avoid horizontal scrolling.

It adjusts the size and shape of content blocks.

It is easier to control layout choices.

It always fits the width of the screen.

Answers

Answer:

Explanation:a & c

Answer:

a c core

Explanation:

Define the following terms: Staff authority ,in your own words.

Answers

Answer:

To provision advise for other services to line managers.

Explanation:

Question:

Define Staff authority

Explanation:

Line managers receive counsel and other services from staff authority. Senior managers must exercise caution when it comes to restricting the number of employee employment. A company might end up with an excessive level of corporate overhead if this does not happen.

------------------------

hope it helps...

have a great day!!

Rate these 3 fnaf characters from 1-3 tell me who you find the scariest as well
MICHEAL AFTON CIRCUS BABY GOLDEN FREDDY

Answers

Answer:

Golden Freddy is the scariest in my opinion

Answer:

Micheal Afton=3/3

Circus Baby=3-3

Golden Freddy=2/3

In my opinion, I'd say Circus Baby because of how her voice sounds like.

The library ....................... open until six o’clock yesterday. *

1 point

(A) remain

(B) remains

(C) remained

(D) will remain​

Answers

Remain is the correct answer I know cuz I did that test and got an A+ on that part

Select the correct answer.
Which statement is true with regard to project scheduling?

O A. Scheduling in plan-based processes does not change with the progress of the project.

B.
Plan-based processes use an iterative approach for scheduling each phase of the project.

O c.
Scheduling in an agile process involves planning the short-term phases of a project.

OD
Agile processes require less detail than plan-based processes do in an initial project schedule.

Answers

Answer:

Agile processes require less detail than plan-based processes do in an initial project schedule.

The statement which is true about projectscheduling is, “Agile processes require less detail than plan-based processes do in an initial project schedule."

What is project scheduling?

Project scheduling is an activity under project management that lists and schedules all the activities, tasks, and objectives related to that particular project. The project schedule makes the work more efficient and smoother since everything is planned prior to its start.

Project scheduling is a task that is genrally used by the managers to list and make a timeline of their projects in order to complete them timely.

Thus, the claim that Agile processes require less detail than plan-based processes do in an initial project schedule. As a result, option D is the best one.

Learn more about project scheduling here:

brainly.com/question/15126136

#SPJ6

one way in which RSI can be prevented?​

Answers

Answer:

Take regular breaks
Do not sit in the same position for long periods. Short, regular breaks can help prevent RSI and other upper limb disorders. It lets the muscles relax while others take the strain.

Explanation:

What is Free Fire? And why it is globally most rated and installed app?​

Answers

Answer:

Free Fire is the ultimate survival shooter game available on mobile. Each 10-minute game places you on a remote island where you are pit against 49 other ...

Explanation:

Write a Short note on Importance of being a good child​

Answers

Answer:

Being a good child is a good thing. It show's the type of person you are. Being a good child means you are most likely responsible with your actions. You are possibly also very kind to others. As a good child, you could also be a very accelerated student in class, gettings a lot of good grades. You might be looked upon by your peers.

Explanation:

Hope this is ok

How to mark someone the Brainliest

Answers

Answer:

Explanation: Once u get more than 1 answer of a question. A message is shown above each answer that is "Mark as brainiest". Click on the option to mark it the best answer.

Answer:

above

Explanation:

Conflict on cross-cultural teams
O is inevitable and should just be ignored until it blows over
O should be handled immediately, so resentments do not grow
O is not likely to happen, since everyone works in basically the same way
cannot really be controlled, since barriers to communication are so high

Answers

Answer:

should be handled immediately, so resentments do not grow

Explanation:

Edge 2021

In a language JUNGLE is codded as UJNGEL then how will BANDID is codded?​

Answers

[tex]\huge\tt\underline\pink{BANDID\:✒\:ABNDDI\:✅}[/tex]

Step-by-step explanation:-

J ⇢ [tex]\sf\purple{U}[/tex]

U ⇢ [tex]\sf\purple{J}[/tex]

N ⇢ [tex]\sf\red{N}[/tex]

G ⇢ [tex]\sf\red{G}[/tex]

L ⇢ [tex]\sf\blue{E}[/tex]

E ⇢ [tex]\sf\blue{L}[/tex]

The first two letters [tex]\sf\purple{"J"}[/tex] and [tex]\sf\purple{"U"}[/tex] are interchanged and they take each other's place respectively. The third and fourth letters [tex]\sf\red{"N"}[/tex] and [tex]\sf\red{"G"}[/tex] maintain their position. The fifth and sixth letters [tex]\sf\blue{"L"}[/tex] and [tex]\sf\blue{"E"}[/tex] also take each other's place respectively.

Following the above sequence, we have

B [tex]\sf\purple{A}[/tex]

A [tex]\sf\purple{B}[/tex]

N [tex]\sf\red{N}[/tex]

D [tex]\sf\red{D}[/tex]

I [tex]\sf\blue{D}[/tex]

D [tex]\sf\blue{I}[/tex]

[tex]\circ \: \: { \underline{ \boxed{ \sf{ \color{green}{Happy\:learning.}}}}}∘[/tex]

Most search engines provide specific pages on which you can search for____ and
_____, among other types of content.

1.
A. government reports
B. images
C. software programs

2.
A. news
B. essays
C. computer games

Answers

Answer: c

Explanation: a

Most search engines provide specific pages on which you can search for government reports and news, among other types of content. The correct options are A and A respectively.

What is a search engine?

A search engine is a piece of software that enables users to use keywords or phrases to get the information they're looking for online.

Even with millions of websites available, search engines are able to deliver results swiftly by continuously monitoring the Internet and indexing every page they come across.

A software programme used to do web searches is known as a search engine. They conduct systematic searches of the World Wide Online for specific data that is defined in a text-based web search query.

The majority of search engines offer specific sections where you can do searches for news and reports from the government as well as other kinds of content.

Thus, A and A are the correct options respectively.

For more details regarding search engine, visit:

https://brainly.com/question/11132516

#SPJ2

What is operating System? Graphically explain the categorias
of operating System. Also mention the type of operating
System you are using
in your home.​

Answers

Answer:

.............................................................. ..........

Which feature of REPL.it would you use to transmit your program to a friend?
execute
share
run
post

Answers

Answer:

share

Explanation:

It's in the name of the option.

Answer:

Its share because Share is when you share to someone or your friend

execute is wrong

run doesnt make sense

post means that your posting a program to the world

Explanation:

what are th sensors of street lights
only light or there something else ?

Answers

Answer:they also provide satellites to vision where roads are

Explanation:

Your team is going to write a program as part of a team. Your teacher may require you to come up with your own goal. If not, use the following goal.

You have been asked by a math teacher to write a program to process a pair of points. The program will find the distance between the points, the midpoint of the two points, and the slope between them.

Plan your program. Meet with your team to plan the program. Assign a task to each member of the team. Record each person's name and their task. Write the program. Test your program. Be sure to test each function of your program. Evaluate the performance of each member of the team. Describe what each member did and how it worked. Record the project in a Word (or other word-processing) document, as described below.

PLEASE HELP WILL GIVE BRAINLIEST AND 20 POINTS!

Answers

Answer: I can help you with the code part if you don’t already have it

# Python3 program to calculate

# distance between two points

import math

# Function to calculate distance

def distance(x1 , y1 , x2 , y2):

# Calculating distance

return math.sqrt(math.pow(x2 - x1, 2) +

math.pow(y2 - y1, 2) * 1.0)

# Drivers Code

print("%.6f"%distance(3, 4, 4, 3))

In this exercise we have to use python knowledge to describe the following code.

The code can be found in the attached image.

We have that code will be described as:

import math

# Function to calculate distance

def distance(x1 , y1 , x2 , y2):

# Calculating distance

return math.sqrt(math.pow(x2- x1, 2) +

math.pow(y2 - y1, 2) * 1.0)

# Drivers Code

print("%.6f"%distance(3, 4, 4, 3))

See more about python at brainly.com/question/18502436

#SPJ2

To find the area, Andrea tiled a rectangle and sketched her answer. Sketch Andrea's rectangle, and find the area. Show your multiplication work.

Answers

Answer:

[tex]Area = 6.25[/tex]

Explanation:

Given

[tex]Length = 2.5[/tex]

[tex]Width = 2.5[/tex]

See attachment for rectangle

Required

Determine the area of the rectangle

Area is calculated as:

[tex]Area = Length * Width[/tex]

This gives:

[tex]Area = 2.5 * 2.5[/tex]

[tex]Area = 6.25[/tex]

The area of Andrea's sketch is 6.25

Zachary drinks 2 cups of milk per day. He buys 6 quarts of milk. How many days will his 6 quarts of milk last?

Answers

Answer:

12 days

Explanation:

There are 2 cups in a pint, and 2 pints in a quart. Therefor, there are 4 cups in a quart. In total, there are 24 cups in 6 quarts. If Zachary drinks 2 cups of milk per day, it will take him 12 days to drink the 24 cups.

If you delete a conversation many times with someone like this, will you stop receiving messages from them, even if you text them

Answers

Yes because they eventually stop caring because u haven’t txt them anymore or vice versa.

Project team member Kevin needs to define the use of change bars to show deleted and modified paragraphs. Under which standards does this fall?
O A.
interchange standards
OB.
identification standards
O C.
update standards
OD.
process standards
O E.

Answers

Answer: C) Update Standards

Explanation: Hope this help :D

CUANDO QUEREMOS EJECUTAR ALGUN TIPO DE EMPRENDIMIENTO, DEBEMOPS DE PENSAR EN TRES TIPOS DE MEDIDAS BASICAS​

Answers

When we want to execute some type of entrepreneurship, we must think about three types of basic measures

Which scenarios could be caused by software bugs? Check all that apply.
A. A person catches the flu and misses two days of work.
B. Smartphone users around the world are unable to get phone service.
C. A person is wrongfully arrested by the police.
D. A person receives a $10 bill at an ATM after requesting a $100 withdrawal.

Answers

Answer:

B- smartphone users around the world are unable to get phone service

C- A person is wrongfully arrested by the police

D- A person receives a $10 bill at an ATM after requesting a $100 withdrawal.

Explanation:

Software bugs are the fault and error in the application that affects the result. It can cause an error in receiving a different bill at ATM after withdrawing a different amount. Thus, option D is correct.

What is a software bug?

A software bug is a flaw or an error occurred in the applications of the system that generates unexpected results and causes crashing, and invalid outcomes.

Some software bugs include functional errors, missing commands, typos, crashes, calculation errors, etc. These types of errors can affect the ATM services causing errors in receipt generation.

Therefore, option D. a $10 bill is generated at ATM after withdrawing $100 is an example of software bugs.

Learn more about software bugs here:

https://brainly.com/question/4490366

#SPJ2

Other Questions
What is the difference between the definitions for ray and line segment?Only the definition of ray relies on an understanding of two directions.Only the definition of line segment relies on an understanding of line.Only the definition of ray depends on an understanding of infinite.Only the definition of line segment depends on an understanding of point. Which options are examples of innovations that increased the carrying capacity of Earth for people? THANKS!Choose all that apply:Advances in heating and cooling.Having fewer children per family on average.Advanced agricultural methods.Medical advances. I really really really need your help 1. How many pyramids are there in Meso- & South America? Is it possible to know the origin of the world? Help pls I need this in 20mins Zoe placed colored blocks on a scale in science class. Each block weighed 0.8 ounces. The total weight of all the colored blocks was 12.8 ounces. How many blocks did Zoe place on the scale? Write and solve an equation to find the answer. A 3.8 g sample of sodium hydrogen carbonate is added to a solution of acetic acid weighing 10.8 g. The two substances react, releasing carbon dioxide gas to the atmosphere. After the reaction, the contents of the reaction vessel weigh 11.6 g. What is the mass of carbon dioxide released during the reaction Decomponha os seguintes nmeros a) 1.585 = b) 1.059= c) 2.440 d) 5.329 e) 8.801 f) 9.999 g) 3.718 h) 6.840 i) 7.504 j) 5.225 1) 4.063 m) 2.597 Pls help will mark brainliest Mi hermano est en el _____(fifth) curso. 1. Find six rational numbers between 2/7 and 5/2 What is a citation?Select one:a.a short listing of reference titles used in a research paperb.any quotation used in a research paperc.a formatted reference to a source used in a research paperd.a footnote giving additional information at the bottom of a pageWhat is a parenthetical reference?Select one:a.a footnote at the bottom of the page giving additional informationb.a listing of citations on a separate page at the end of the paperc.a way of crediting a reference within the body of the textd.additional information within the text set apart in parenthesesWhich of the following must be included when citing a Web site?Select one:a.the authors nameb.the entire URL placed insidec.the date you accessed the sited.the publisher What is 10% of 7,518? What is the area of this circle? Im so confused help meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee what is the process of reproduction between human and animals? What is the volume of the cube shown??? A tank initially contains 100 gallons of brine with 10 lb of salt dissolved in it. Brinecontaining 0.4 lb of salt per gallon ows from an outside source into the tank at a rateof 5 gal/min. The mixture is discharged out of the tank at the same rate of 5 gal/min..Assume that solutions are well-stirred at all times.Required:Find the amount of salt in the tank at the end of 40 minutes. what is the relative frequency of eighth-graders who want fruit smoothies