Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The purpose of the first programming exercise is to familiarize you with the programming standards and coding conventions that are required for this course. All
The purpose of the first programming exercise is to familiarize you with the programming standards and coding conventions that are required for this course. All students taking this course are expected to have a certain level of proficiency which includes the ability to read and understand code written by others. Students are also expected to write code that efficiently implements and tests various algorithms using programming constructs studied in your programming classes and functions whose syntaxes and usage information you can find in ANSI/ISO C++ 11 language documentation. In this exercise and all subsequent programming projects, you will be ex pected to properly document your code using the coding conventions for this course, program in multiple files so that there is a wall between the public interface and implementation of your algorithms as well as the application that uses the implementation. This assignment will test your ability to follow this approach to programming no matter what IDE (integrated development environment) that you use to write your code. Your code will be tested using ANSI/ISO C++ 11. Your program will be considered acceptable for grading only if it compiles without any syntax errors. You will generally submit only your source code, the .cpp and .h files, in a zip archive file via a drop box on Moodle for grading Definition 1. Empirical algorithmics is a computer science area of spe- cialization that involves the use of experimental and statistical, rather than theoretical, methods to analyze the behavior of algorithms The PowerAnalyzer Program The PowerAnalyzer.cpp file will consist of only one function, the main. The main function will perform the following tasks 1. It prompts the user to enter the base of a power 2. It prompts the user to enter the exponent of a power 3. It computes the powers using both the fast and naive algorithms and 4. It randomly generates a four-digit positive integer for the base of a 5. It randomly generates a two-digit positive integer for the exponent of displays the powers power a powen 6. Similarly, it computes the powers using these randomly generated in- tegers and both the tast and naive algorithms and displays the powers 7. It prompts the user for a positive integer to be used as the base in measuring and displaying runtimes for generating various powers of the base 8. For n-16, 32, 64, 128,256, 512,1024,2048, 4096, 8192], your program will compute, using the naive and fast exponentiation algorithms, pow- ers of the base entered by the user and measure and display the exe- cution times in nanoseconds for these algorithms as shown in the table in the sample run Additional Requirements Test the program to ensure that it works correctly and generates its output in the same format as shown in the sample run. A Big Integer calculator at http://www.javascripter.net/math/calculators/100digitbigintcalculator.htm powers calculated by your program are correct
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started