Find Jobs
Hire Freelancers

C++ assignment 2

$10-30 CAD

Completed
Posted over 10 years ago

$10-30 CAD

Paid on delivery
Problem Statement: Implement the function justify in the file [login to view URL] to perform left and right justification on a text input of type string. The justified text is a vector of strings (see new type PARA in justify.h). Text justification is a part of typesetting, where a ragged text is transformed into a text that neatly fits into a column of given width. The assumptions for the input text are as follows: 1. The input text is a single unjustified string terminated by a null (‘\0’) character. 2. The input text consists only of alphabets (lower and upper case), blank spaces (‘ ‘), and two punctuation marks (periods (‘.’), and commas (‘,’)). 3. Every word in a sentence in the input text is separated by a single blank space. 4. The punctuation marks immediately follow the last character of the preceding word, and a single space is present between a punctuation mark and the following word. 5. There are no new line characters in the input string. We will perform a very primitive form of justification in this assignment using the following rules: 1. Every line in the justified text must have at least width – 2 characters, with the exception of the last line, which may have fewer characters. 2. Every line in the justified text must have at most width characters, with the exception of lines that terminate with a punctuation mark (period or comma). In such cases, the line may have width+1 characters to accommodate the trailing punctuation mark. 3. Every line in the justified text must start with an alphabet (word). The first character in a line cannot be a punctuation mark or space. 4. If a word needs to be split across lines in order to follow the above rules, a hyphen (‘-‘) character must be inserted after the first part of the word. The hyphen character counts toward the total number of characters in a line. Development Methodology You are given four C++ source files in an archive. Extract the archive on your PC (or Linux server) and change into the directory. Inside you will find the following files: 1. studentID.h: This file should contain your student ID. For now, it has a placeholder value “123456”. Please put your student ID here. It is very important that you change the value to your correct student ID, otherwise we will deduct 1 point from your score, because a missing ID causes significant burden for testing your program and evaluating your grade. 2. justify.h: This is a header file that defines error codes, PARA type and useful macros. Do not edit or submit this file. 3. [login to view URL]: This is the file where the justify function must be implemented. You must edit and submit this file. 4. [login to view URL]: This is the file where the main function, used for testing the program, resides. You should NOT submit this file, although you may choose to modify it for testing.
Project ID: 5174185

About the project

3 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, a m experienced with C and C++ and I am able to complete this task in 24 hours, maybe sooner, if needed.
$15 CAD in 1 day
5.0 (157 reviews)
5.8
5.8
3 freelancers are bidding on average $23 CAD for this job
User Avatar
Hello 20+ years of C++ experience, 10 years as freelancer 300+ projects completed. > I´ll send you a full tested and documented program (in code). No external documentation. > Unlimited cycles of revision in the agreed time period. > Full advice about the best way to do the implementation. Please contact me to discuss the details. Thanks.
$30 CAD in 1 day
5.0 (2 reviews)
2.4
2.4
User Avatar
I Used to work as a software engineer for 3 years. Good at C++ and linux. Can finish it perfectly. Thanks.
$23 CAD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of CANADA
Montreal, Canada
5.0
6
Payment method verified
Member since Nov 11, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.