Ask C/C++ Expert


Home >> C/C++

Part 1: Write, Run, and Observe the Application

Review Hello World!, Variables and Basic IO and create an application that determines miles-per-gallon, if you know the number of miles driven and number of gallons of gas you put in the tank.

Follow these steps to complete Part 1 of your assignment.

1. Access the Toolwire desktop environment via the Toolwire resources in Unit 1.

2. Launch Code::Blocks.

3. Click the following:
- File, New, Project.
- Console Application.
- Go.
- Next.
- C++.
- Next.

4. In the Project Title field, type calcMileage.

5. In Folder to create project in:, click ...

6. In Folder, click Make New folder and type calcMileage.

7. Click the calcMileage folder.

8. Click OK.

9. Click Next.

10. Click Finish.

11. Open the main.cpp file under Sources.

12. In the editor, type the following calcMileage application, using this template.
#include

using namespace std;

int main()
{
int miles;
int gallons;
float mpg;

cout << "Enter miles: ";
cin >> miles;
cout << "Enter gallons: ";
cin >> gallons;
mpg = miles / gallons;
cout << "Miles per gallon: " << mpg;
return 0;
}

13. Click Build, Build and Run.

14. Enter the number of miles.

15. Enter the number of gallons.

16. Observe the results.

17. Assignment Overview

18. For this assignment, you will write your first C++ application, called calcMileage. The goal of this program is to determine miles-per-gallon based on the number of miles driven and the number of gallons of gas you put in the tank. You will use the Code::Blocks software to write this application. Access this software via the Toolwire virtual desktop activity link in this unit.

19.

20. Assignment Instructions

21. Part 1: Write, Run, and Test the Application

22.

23. Use the code in the Unit 1, Part 1 Assignment Instructions document linked in the Resources to complete this part of your assignment. Be sure to test the application with a variety of values before you proceed to Part 2. The program produces accurate results with some numeric values but not with others. Note when the results are accurate and when they are not.

24.

25. Part 2: Improve the Application

26.

27. Based on the material in the study, modify the code to fix the accuracy problem. Be sure to comment and format the code.

28.

29. Part 3: Describe the Application

30.

31. After running your application and observing the results, write a 1-2 page paper in which you complete the following:

32.

33. Define the variables in an application.

34. Define the expressions in an application.

35. Explain the data types in an application.

36. Discuss the cause of the inaccuracy in the original code and the approach used to fix the problem.

37. Ensure that your writing is professional and consistent with the standards and conventions of the IT community.

38.

39. Submit both the .cpp source code file and the Word document with the paper.

40.

41. Submission Requirements

42. Refer to the Variables, Expressions, and Data Types Assessment Scoring Guide to ensure that you meet the grading criteria for this assessment.

43.

44. Your completed assignment should include the following:

45.

46. Demonstrate the ability to apply math in a program.

47. Define the variables in an application.

48. Define the expressions in an application.

49. Explain the data types in an application.

50. Communicate effectively in a business environment.

When complete, compress your C++ program into a ZIP archive and submit your archive in the assignment area.

Be sure to name your archive using the following format IT3348_u01a1_FirstName_LastName.zip

Part 2: Branching, Logic, and Functions

Resources
- Branching, Logic, and Functions Scoring Guide.

Assessment Context
By successfully completing this assignment, you will demonstrate your proficiency in the following course competencies and objectives:
- Competency 1: Define business problems that can be solved using basic programming concepts and standards.
o Define the requirements for an application.
o Describe the stakeholders needed to further define an application.
o Describe the ethical issues relevant to an application.
Competency 2: Analyze intermediate object-oriented programming.
o Analyze the behavior of basic, procedural-based programming constructs.
o Explain how an application works.
Competency 4: Design a program that applies intermediate programming concepts and constructs.
o Write a program that applies basic data structures.
Competency 5: Communicate effectively.
o Communicate effectively in a business environment.

Assignment Overview
For this assignment, you will write a C++ application called calcPay for a financial company. The goal of this program is to determine gross pay for a 4-week pay period based on an hourly rate and the number of hours worked in each week of the pay period. Anyone working over 40 hours a given week earns time-and-a-half. You will use the Code::Blocks software to write this application. Access this software via the Toolwire virtual desktop activity link in this unit.
Assignment Instructions

Part 1: Write the Application

Write a C++ console application that asks the user to enter the hourly wage and number of hours worked for each week in a 4-week pay period. Create a custom function with appropriate input parameters and return type that calculates the total gross pay based on the values entered by the user. Use suitable loops for the user input and the processing of data entered by the user. The program should print out the gross pay for the pay period for the employee.
Part 2: Describe the Application
Write a 3-5-page paper in which you complete the following:
- Define and document the requirements for the calcPay application.
- Describe the stakeholders needed to help further define the application.
- Describe a collaboration plan for working with stakeholders.
- Analyze the behavior of basic, procedural-based programming constructs.
- Define the functions you have used in your application.
- Define the IF statements you have used in your application.
o Explain how the IF statements work.
Define the loops you used in your program.
o Explain how the loops work.

Explain how your application works and any issues you encountered with the application.

Include a screen shot of your application, using the Print Screen function, to show that your application works.

Submit both the source code file(s) and the Word document with the paper.

Submission Requirements

Refer to the Branching, Logic, and Functions Assignment Scoring Guide to ensure that you meet the grading criteria for this assignment.
Your completed assignment should include the following:
- Write a program that applies basic data structures.
- Define the requirements for an application.
- Describe the stakeholders needed to further define an application.
- Describe a collaboration plan for working with stakeholders.
- Analyze the behavior of basic, procedural-based programming constructs.
- Demonstrate the ability to apply math in a program.
- Explain how an application works.
- Communicate effectively in a business environment.

When complete, compress your C++ program into a ZIP archive and submit your archive in the assignment area. Be sure to name your archive using the following format IT3348_u02a1_FirstName_LastName.zip

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91995209
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in C/C++

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As