Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7412975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:37:28+00:00 2026-05-29T06:37:28+00:00

In my c++ class, we got assigned pairs. Normally I can come up with

  • 0

In my c++ class, we got assigned pairs. Normally I can come up with an effective algorithm quite easily, this time I cannot figure out how to do this to save my life.

What I am looking for is someone to explain an algorithm (or just give me tips on what would work) in order to get this done. I’m still at the planning stage and want to get this code done on my own in order to learn. I just need a little help to get there.

We have to create histograms based on a 4 or 5 integer input. It is supposed to look something like this:

Calling histo(5, 4, 6, 2) should produce output that appears like:

        *
    *   *
    * * *
    * * *
    * * * *
    * * * *
    -------
    A B C D

The formatting to this is just killing me. What makes it worse is that we cannot use any type of arrays or “advanced” sorting systems using other libraries.

At first I thought I could arrange the values from highest to lowest order. But then I realized I did not know how to do this without using the sort function and I was not sure how to go on from there.

Kudos for anyone who could help me get started on this assignment. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:37:30+00:00Added an answer on May 29, 2026 at 6:37 am

    Try something along the lines of this:

    1. Determine the largest number in the histogram
    2. Using a loop like this to construct the histogram:

      for(int i = largest; i >= 1; i--)

      Inside the body of the loop, do steps 3 to 5 inclusive

    3. If i <= value_of_column_a then print a *, otherwise print a space

    4. Repeat step 3 for each column (or write a loop…)

    5. Print a newline character

    6. Print the horizontal line using -

    7. Print the column labels

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a class, like this, simplified: public class Bookmark { public string Nav
I've got a class representing an interval. This class has two properties start and
I've got two models that look like this class Stage include DataMapper::Resource property :id,
I've got a Viewmodel that looks like this: public class Viewmodel { public int
I've got a click event assigned to a div of a particular class. When
below code is my databasehandler class i got it from a tutorial. Beside that
I've created a simple class and got a little problem: I just want to
Question about subclassing in matlab, under the new class system. I've got class A
I've got a class that looks like: public class Competitor { public virtual int
I've got a class named Hasher in a namespace named Hasher. So the fully-qualified

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.