Show Bid Request
Functions
Bid Request Id: 36890
|
|
|
Posted by: |
aminew (21 ratings)
(Software buyer rating 10)
|
Non-action Ratio: |
Very Good - 0.00%
|
Buyer Security Verifications: |
Good
|
Approved on: |
Nov 24, 2002 3:14:50 PM EDT
|
Bidding Closes: |
Nov 25, 2002 6:19:17 PM EDT
|
Viewed (by coders): |
65 times
|
Deadline: |
11/25/2002 7:19:17 PM
TIME EXPIRED
|
|
|
|
Description:
This program requires you to write and use some functions, and answer some quiz questions.
Part 0
Write a function that prompts the user to enter a line length. If a -99 is entered, then return to the caller the total number of lines printed; otherwise, print an error message if the entered value is less than 0 or greater than 80. If the entered number is between 0 and 80, then prompt the user to enter a character. Print a line using the entered character having a length equal to the entered line length.
At most 10 lines can be printed. This value is passed as an argument to the function.
Part 1
Write a function that prompts the user to enter two characters. If the user enters a tilde character (~), then return the number of results printed. Otherwise, print a message indicating which character is bigger and which character is smaller.
At most 10 results can be printed. This value is passed as an argument to the function. In addition, the sentinel value for this part (i.e. the tilde) is also passed as an argument to the function.
Part 2
Write a function that prints the answers to the following questions. There should be only one answer per line. Each answer must be prefixed with the question number followed by a closing (i.e. right) parenthesis. The function returns the number of lines printed.
What will the following code snippet print?
double d = 10.0;
int result = d / 3;
cout << result;
What will the following code snippet print?
int i = 1, j = 2, k = 3;
if (i && j == 2 || k)
cout << "hello";
else if (!i && !(k == 3))
cout << "Hello";
cout << " world";
What will the following code snippet print?
int k=10;k++;++k;k++;if(k<=13)cout<<"yes";else cout <<"no";
How many times will the following loop print the string "foo"?
for (int i = 1000; i > 0; i %= 10)
cout << "foo" << endl;
What value will be assigned to the variable 'i'?
int a = 5, b = 10;
int i = ((a != b) && (b > 0) && (a <= b)) ? (b * a) : (b - a);
Part 3
Prior to ending the program, print the total number of lines printed by all of the functions used in the program. This value does not include heading lines, error messages, and prompts.
Deliverables: 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2)
Notes
All prompts and error messages must be written to the standard error stream.
Here are function prototypes you can use.
int printQuiz(void);
int printLines(int maxLines);
int compareChars(int maxResults, char sentinelValue);
The body of your main() function may look something like the following.
int nLines = 0; // count total number of lines printed
int partNbr = 0; // print heading for each Part printed
printPartHeading(partNbr++);
nLines += printLines(MAX_LINES);
printPartHeading(partNbr++);
nLines += compareChars(MAX_RESULTS, PART1_SENTINEL_VALUE);
printPartHeading(partNbr++);
nLines += printQuiz();
printPartHeading(partNbr++);
cout << "Total number of lines printed: " << nLines << endl;
return EXIT_SUCCESS;
// MAX_LINES, MAX_RESULTS, PART1_SENTINEL_VALUE are
// programmer defined manifest constants.
You do not have to write the function printPartHeading(); however, one extra credit point will be awarded if you do.
Output
The output of program does not need to include the prompts. The prompts are provided to help give you an idea as to how the program looks from a user's perspective.
For documentation purposes, user inputs are enclosed in brackets < >
------
Part 0
------
Enter a length (-99 to exit this part): <10>
Enter a character: <=>
==========
Enter a length (-99 to exit this part): <5>
Enter a character: <:>
:::::
Enter a length (-99 to exit this part): <-1>
*** error: -1 is invalid input
Enter a length (-99 to exit this part): <-99>
------
Part 1
------
Enter character number 1 (~ to exit this part): <)>
Enter character number 2 (~ to exit this part): <(>
) is greater than (
Enter character number 1 (~ to exit this part): <+>
Enter character number 2 (~ to exit this part): <9>
9 is greater than +
Enter character number 1 (~ to exit this part): <9>
Enter character number 2 (~ to exit this part): <{>
{ is greater than 9
Enter character number 1 (~ to exit this part): <~>
------
Part 2
------
1) 5
2) hello world
3) yes
4) 3
5) 10
------
Part 3
------
Total number of lines printed: 10
Platform:
windows xp
Must be 100% finished and received by buyer on:
Nov 25, 2002 7:19:17 PM EDT
Deadline legal notes: All times are expressed in the time zone of the site EDT (UT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EDT on the indicated date.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$11 (USD)
|
Nov 24, 2002 3:54:05 PM EDT
|
4.75
(Average)
|
|
|
I believe I have required skills to help you solve your problem. I have over 6 years of experience working as a professional programmer, and doing task like yours should be relatively easy for me.
I will explain you everything you need to be sure that the result will be the one we both expecting.
Good luck to you on your project!
Best Regards.
|
|
|
|
|
|