1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ki77a [65]
4 years ago
11

Define the method object inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids.Sample output for the g

iven program with one call to inc_num_kids():Kids: 0New baby, kids now: 1
Computers and Technology
1 answer:
topjm [15]4 years ago
4 0

Answer:

class PersonInfo:

   def __init__(self):

       self.num_kids = 0

   def inc_num_kids(self):

       self.num_kids += 1

person1 = PersonInfo()

print('Kids:', person1.num_kids)

person1.inc_num_kids()

print('New baby, kids now:', person1.num_kids)

Explanation:

Line 1 of the code, we define the class PersonInfo. Line 3 of the code is the function that will increment the member data num_kids.

You might be interested in
Can we opne a website form PowerPoint slide ​
Phoenix [80]

Answer:

Yes

Explanation:

Type in the link, play the presentation and click the link. Or hover over the link and press ctrl + click at the same time. (Don't know if I got the last part right)

3 0
4 years ago
Read 2 more answers
A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit wi
Mamont248 [21]

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int qty;

   float discount = 0;

   cout<<"Quantity: ";

   cin>>qty;

   int cost = qty * 100;

i f (cost > 1000) {        discount=cost * 0.10;        }

   cout<<"Cost: "<<cost - discount;

   return 0;

}

Explanation:

This declares the quantity as integer

   int qty;

This declares and initializes discount to 0

   float discount = 0;

This prompts the user for quantity

   cout<<"Quantity: ";

This gets input for quantity

   cin>>qty;

This calculates the cost

   int cost = qty * 100;

If cost is above 1000, a discount of 10% is calculated

i f (cost > 1000) {        discount=cost * 0.10;        }

This prints the cost

   cout<<"Cost: "<<cost - discount;

4 0
3 years ago
Complete the code.
Dmitrij [34]

<u>Answer</u> : Float

<u>Explanation</u> :

Complete the code.

import csv

inFile = open ("one.txt","r")

outFile = open("another.txt", "w")

myReader = csv.reader(inFile)

for item in myReader:

aWord = item[0]

aNumber = float(item[1]) + 0.4

line = aWord + "," + str(aNumber) + 'Float'

outFile.write(line)

3 0
3 years ago
2. Part of a pie chart that represents one value from the series.
mina [271]

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

A. Axis

4 0
3 years ago
Harold included an excerpt from an Internet magazine in an article he wrote for the school newspaper. However, he did not ask pe
neonofarm [45]

Could be all of the above. But for school i'd assume only a suspension.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which statement is true
    12·1 answer
  • Alisha's teacher usually includes lots of comments on student tests to help them understand why their answers were
    8·2 answers
  • How can we lock pubg game from Play Store???​
    12·2 answers
  • What came after the Phonograph
    13·2 answers
  • Which activity should be part of a long-term plan to positively affect your
    5·1 answer
  • Which type of computer network ensures high security
    10·1 answer
  • Among the second generation home console companies,which managed to come out on top
    10·1 answer
  • 1)What is Big Data?
    14·1 answer
  • have you ever had to adjust your communicatio style to egage a customer or roommate? what was the situation and outcome?
    5·1 answer
  • Which part of the computer coordinates all computer operations and performs arithmetic and logical operations on data
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!