Question Details

[solution] » Help me fix the problems of my code, it works but system didnt

Brief item decscription

Step-by-step solution file


Item details:

Help me fix the problems of my code, it works but system didnt
More:


Help me fix the problems of my code, it works but system didnt let me pass . task9.txt is the test result!!!!!!

Requirements
  1. Read integer values from stdin, separated by one or more spaces or newlines, until reaching EOF.
  2. The input is guaranteed to be well-formed.
  3. The input contains no more than 80 values.
  4. On standard output, render a simple vertical column graph representation of the input values, in order left to right, using hash '#' characters as shown in the examples below. The number of hashes printed in each column should be equal to the corresponding input value.
  5. The area above a completed column should be filled with space characters.
  6. Ignore empty lines. Do not output a column for an empty line.
  7. The entire graph must end with a newline character.


Guide

Hint: you may find it helpful to draw your graphs upside down(increasing down the screen) first, then change your code to flip theoutput it up the right way.

Examples
  1. Input: Output: The requirements mean that the graph fills a rectangular area with hashes and spaces, so this example is printed as:
    1 1 3 1 # # #### ' ', ' ', '#', ' ', 'n' ' ', ' ', '#', ' ', 'n' '#', '#', '#', '#', 'n' 
    In particular, notice the spaces before the newlines on the first two lines. They are necessary.
  2. Input: Output:
    3 4 5 # ## ### ### ### 
  3. Input: Output:
    0 3 0 4 5 # ## # ## # ## # ## 
    Notice the empty columns that correspond to the zeros in the input, including the leading zero.
  4. Input: Output:
    5 15 16 15 12 12 12 8 6 3 2 19 21 17 15 12 11 10 9 8 7 7 # # ## ## ### # ### ### #### ### #### ### #### ###### ##### ###### ###### ###### ####### ###### ######## ####### ######### ####### ########### ######## ########### ######### ########### ######### ########### ########## ########### ###################### ###################### 
  5. Input: Output:
    0 0 2 1 0 # ## 

repo./2

 

Testing Repo repo./2 Lab 2 Task 9 at 2016-10-06 17:44:05.271954

 

Build operations: gcc -Wall -std=gnu99 -g -o t9 REPO/verticalgraph.c -lm

 

build OK Build succeeded.

 

Unit test /home/vaughan/lab/2/testdir/t9/3: /home/vaughan/build..0rK8m1 t9 Running Program... Done. Program returned 0

 

Error: Your program wrote incorrect output on stdout.

 

Your output was too large to copy here. Oops.

 

Unit test /home/vaughan/lab/2/testdir/t9/1: /home/vaughan/build..0rK8m1 t9 Running Program... Done. Program returned 0

 

Error: Your program wrote incorrect output on stdout.

 

Your output was:

 

 

 

 

 

 

 

 

 

 

#

 

##

 

###

 

####

 

#####

 

######

 


 

Unit test /home/vaughan/lab/2/testdir/t9/2: /home/vaughan/build..0rK8m1 t9 Running Program... Done. Program returned 139 Error: Your program returned nonzero status code 139 stdout --------------------------------------------------- (empty) *** SEGMENTATION FAULT *** stderr --------------------------------------------------- (empty) ----------------------------------------------------------

 

Unit test /home/vaughan/lab/2/testdir/t9/5: /home/vaughan/build..0rK8m1 t9 Running Program... Done. Program returned 139 Error: Your program returned nonzero status code 139 stdout --------------------------------------------------- (empty) *** SEGMENTATION FAULT *** stderr --------------------------------------------------- (empty) ----------------------------------------------------------

 

One or more unit tests failed. Task failed.

 

REPO <function repo at 0x279d938>

 







About this question:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Feb 21, 2020

PRICE: $24

Solution~00066174051.zip (18.37 KB)

Buy this answer for only: $24

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card. All your purchases are securely protected by PayPal.
SiteLock

Need a similar solution fast, written anew from scratch? Place your own custom order

We have top-notch tutors who can help you with your essay at a reasonable cost and then you can simply use that essay as a template to build your own arguments. This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student. New solution orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

Order Now