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
Iteru [2.4K]
3 years ago
6

Write a recursive method in pseudo code that returns the number of 1's in the binary representation of n. use the fact that this

equal to the number of 1's in the representation of n/2, plus 1, if n is odd.
Computers and Technology
1 answer:
Deffense [45]3 years ago
4 0
Int count(int num)

if   num==0   return  0;
return   (n&1)+count (n/2)


You might be interested in
If necessary, create a new project named Advanced19 Project, and save it in the Cpp8\Chap06 folder. Enter (or copy) the instruct
Digiron [165]

Answer:  If a customer orders more than four pizzas, the program should deduct 10% from the cost of the order. Modify the program appropriately, and then save, run, and test it.

4 0
3 years ago
How often do you give or receive interpersonal support through social media? Consider times when you’ve exchanged supportive mes
Naily [24]

I receive interpersonal support on almost every sight I go on: even on this one right now! An example of interpersonal support can be a typing editor, I believe.

8 0
3 years ago
2 inventions revolutionized photography, what are they?
kotegsom [21]
1. George Eastman's film, which was used for early motion pictures,
2. Polaroids instant film, which after being removed from the camera would dry and reveal a picture.

I hope this helps, I had to research these :)
6 0
3 years ago
Which of the following does not illustrate an effect of media on human communication?
Lyrx [107]

I'd choose B as the answer.

Our entire social lives these days are mediated and we are now leaving in a mediated era. Social media, for instance, has profoundly influenced in inter-personal communication. Options A and D contributes to the interaction and the fulfillment of peoples’ social needs and social media has become a preferred mode of communication with the rise of digital and mobile technologies. Social media has negatively impacted and reduced face to face interactions of human beings, whether business wise or through personal communication. Option C also illustrates an effect of media on human communication, which only leaves us with option B

3 0
3 years ago
Write a program that converts a decimal height in feet into feet and inches.
Naily [24]

The program to illustrate the conversion of the height is illustrated below.

<h3>How to illustrate the program?</h3>

The information here is to convert 1 inch = 2.54 cm. First, we will take user input of height in cm. We first convert this to inches by dividing by 2.54

After that, we use Floor Division // and Modulo % by 12 to get feet and inches respectively.

The inches will be in a lot of decimals. We round this off to 2 decimal places and finally print out the converted height.

The code will be:

# Take user input for height in cm

height_cm = float(input("Enter your height in cm: "))

# Convert height to inches

height_in = height_cm / 2.54

# Get feet by taking floor division with 12

feet = height_in // 12

# Get inches by taking modulo division with 12

inches = height_in % 12

# Round off the inches to 2 decimal places

inches_rounded = format(inches, ".2f")

# Print out the height in feet and inches

print(f"Height is {feet} ft {inches_rounded} in")

Learn more about program on:

brainly.com/question/26134656

#SPJ1

4 0
2 years ago
Other questions:
  • In Java, a char variable is capable of storing any Unicode character. Write a statement that assigns the Greek letter ^ to a cha
    7·1 answer
  • Which of the following protects against cave-ins? A. All answer choices protect against cave-ins B. Shielding C. Shoring D. Slop
    5·2 answers
  • A certain database has numerous tables, but they do not share any fields in common. this database will not be as powerful as oth
    15·2 answers
  • 1| def saveUserProfile(firstName, lastName, age, height, country):
    7·1 answer
  • Which group on the home tab contains the line spacing attribute?
    7·1 answer
  • Purpose: This application provides experience with user input and interaction in the Console, writing files to disk, working wit
    9·1 answer
  • To do a good job of searching periodicals at your library, you should use A) the Library of Congress Authorities webpage. B) web
    10·1 answer
  • What is the square root of 1600 and 36 ?​
    6·1 answer
  • What can be defined as in information technology environment?
    14·2 answers
  • Look at the four schematic symbols shown in the figure above. Each of the symbols is labeled with a number. Which of the followi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!