Demonstrate your programming abilities in cpp

Assignment Help C/C++ Programming
Reference no: EM131964803

Lab Assignment

Use the vector class to implement the addition a list of 26 huge integers. Also, you can implement the multiplication of the first two of these huge integers.

Purpose: Using the dynamic C++ templated vector class, write a program to add integers of any size. Your program will use methods in the standard C++ vector class to solve this problem. The input file will be read in as a string. Each string will be parsed and processed to store each digit into a vector. For example "1234567" will be processed into a vector object as [7, 6, 5, 4, 3, 2, 1, 0, 0, 0]. Notice this is backwards from its original number. However, this allows you to easily add digit by digit (left to right) into another vector object (also left to right) containing the accumulated sum. Note: this lab will replace your lowest lab score, and thus it will elevate your overall lab average score (40% of your final grade). It will not lower your overall lab score.

Problem:

1. Demonstrate your programming abilities in C++ by adding a given list of the first 26 very large integers (given in this specification sheet). You must use these data as input for your program.

2. The LargeTester.cpp will contain a "clean" main function and other functions you have designed to solve this problem.

3. After reading all the data in the file, close it and print your sum to the console and the output file.

4. For 10 points extra credit, your output skips 2 lines and re-displays the first two large integers, again. The next line should indicate the product of these two large integers. Send these 1st two large integers and product to both the console and to the output file.

5. There is a total of 26 large integers in the input file. You must use only this given input file.

6. To simplify the work in this last week, it is not necessary to format your large integers by right justifying them. Simply left justify all displayed outputs (in normal forward order).

7. When coding this lab project use copious comments to explain your solution. Document at least 50% of your code with comments. In other words if the class is 200 lines in length, document at least 100 of these lines with copious comments explaining your algorithm.

Input: Big26.in.txt (contains all 26 large integers to be read-in to your program). See the reverse side for the data.

Output: Echo Print all numbers read from the input file to the console and to the output file: Big26.out.txt. Additionally, the output file and console should indicate the sum (answer to adding all 26 numbers together). The extra credit function product will be similarly echo printed to both the console and the output file.

Checklist:

a. Print hard copies of your main file, LargeTester.cpp, Big26.in.txt, and Big26.out.txt.

The contents of the input file named: Big26.in.txt

27306206970702988134943455267
266653329641143800
692463309474
77398676015767719177524639281
3576180881983944117472340747925372
46727919169057102111
308757573234218091406187416940
510359921794679320320476
3641052680337839495115059
825372641582
2598510157997889186440938229
9089793549598160057
51163593833189098463897929410008623
7760861056897584938
6674786207173262962967975825945
3810612824
63423484013383433188
9479275622359614292930536791567664
1969366697062705198402050141905
99682648675
398958598215660852932804
74540765624605446300457
71520216939
718759950466335291172205
5540984481409
79416202465135548741890

Reference no: EM131964803

Questions Cloud

Difference exists between the populations : The alternate hypothesis claims that no difference exists between the populations being tested using random sample results from each.
Determine the location and amenities for the stadium : Write a paper explaining how you will determine the location and amenities for the stadium - What sources of funding/sponsors will you seek for building
Identify presenting concerns from the client perspective : Identify presenting concerns from the client's perspective as described in the video and accompanying narrative. Include relevant cultural and systemic.
Interest rate on current debt and the initial purchases : Your interest rate on current debt and the initial purchases is 9 percent and the tax rate is zero.
Demonstrate your programming abilities in cpp : Demonstrate your programming abilities in C++ by adding a given list of the first 26 very large integers (given in this specification sheet).
What is your opinion on this issue and why : Both FCC and U.S. Federal Aviation Administration ban in-flight cellular calling. Though there are technical and security issues at play
There were no other transaction costs or finance charges : There were no other transaction costs or finance charges. How much will Audrey’s balloon payment be in eight years?
What is the stock expected price three years : ABC Enterprises' stock is expected to pay a dividend of $1 per share. What is the stock's expected price 3 years from today (i.e. solve for P3)?
How would you determine if your strategies were effective : Describe three strategies that you would try to improve their behavior and include the reasons you chose those strategies

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write cpp program that is menu-driven that allows for choice

Write a C++ program that is menu-driven that allows for the following menu choices: Load an exam: Loading an exam should prompt the user for an exam file.

  Prints the row sums and the column sums

Write a program that reads a 5 x 5 array of integers and then prints the row sums and the column sums

  Use and provide information with minimal difficulty

Smartphones today have changed our ability to find, use and provide information with minimal difficulty, however, in the past ten years, smartphones have changed from single user oriented to multi user connectivity. For example, in our last class tim..

  Print each employee''s identification number

1) in a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles) A) Define two arrays that may be used in parallel to store the 10 employee indentificcation numbers and gross pay amounts B..

  Describe the purpose of the hierarchical nature of

q1. explain the purpose of the hierarchical nature of traditional structured design.q2. describe what kinds of systems

  Compile the program and return its errors

I got it down to one error by putting int MAX = 60; under the main functin and taking the .h off iostream etc. but still had one error and not sure if that was right anyway.

  Write an application that creates a quiz

Write an application that creates a quiz, which contains at least 5 questions about a hobby, popular music, astronomy, or any other personal interest.

  Write a program that converts each name

You are given a file consisting of students? names in the following form: lastName, firstName middleName. (Note that a student may not have a middle name.) Write a program that converts each name to the following form: firstName middleName lastNam..

  Calculate and prints the average of the ratings

Write a C program that accepts by keyboard input (8) user-ratings of the Galaxy S5. The ratings use a scale of 1 to 10, where 10 represents a high rating and 1 represent a low rating: Calculate and prints the average of the ratings

  Define and implement a default constructor for robot class

Define and implement a default constructor for the Robot class that sets the locations to zero, and load to false (no load is being carried by the Robot)

  Write a cpp program to implement a queue using linked lists

Write a C++ program to implement a queue using linked lists. The program should provide the following functionality: Enqueue data into queue.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd