Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview: In this course, you will be responsible for completing a number of programming-based assignments by filling in the missing pieces of code. Learning to

Overview: In this course, you will be responsible for completing a number of programming-based assignments by filling in the missing pieces of code. Learning to program in C++ requires developing an understanding of general programming concepts and learning the syntax of the C++ programming language. These exercises will build on each other and help you cultivate you programming knowledge. It is recommended that students do not limit their practice to just that which is graded. The more you write your own code, the more proficient you will become with the tools and techniques available to you in C++. Prompt: Your submission should include your completed source code. The following critical elements should be addressed in your project submission: Code Description: A brief explanation of the code and a brief discussion of any issues that you encountered while completing the exercise. Functioning Code: A source code must meet its specifications and behave as desired. To develop proper code, you should produce fully functioning code (produces no errors) that aligns with accompanying annotations. You should write your code in such a way that the submitted file(s) actually executes, even if it does not produce, the correct output. You will be given credit for partially correct output that can actually be viewed and seen to be partially correct. Code Results: Properly generated results establishes that your source code: A. Generates accurate output B. Produces results that are streamlined, efficient, and error-free Annotation / Documentation: All added code should also be well commented. This is a practiced art that requires striking a balance between commenting everything, which adds a great deal of unneeded noise to the code, and commenting nothing. Well-annotated code requires you to: A. Explain the purpose of lines or sections of your code detailing the approach and method the programmer took to achieve a specific task in the code B. Document any section of code that is producing errors or incorrect results. Style and Structure: Part of the lesson to be learned in this course is how to write code that is clearly readable and formatted in an organized manner. To achieve this, you should: A. Develop logically organized code that can be modified and maintained; B. Utilize proper syntax, style, and language conventions/best practices Guidelines for Submission: For each exercise, your submission is the completed source code file containing functioning code and should start with a header comment containing a title (name, course, date, project number) and your discussion of the code.

// DataTypes.cpp : The data types to declare each of the variables is missing.

// Based on the value being stored in the variable and the comments beside it,

// fill in the data type at the beginning of each line. Then compile and run

// program to make sure you selected the correct types.

//

// After you submit your answers, try changing the values stored in the

// variables. What can you learn about the different data types?

//

#include

#include

using namespace std;

int main()

{

classAverage = 90.7; //Decimal number

letterScore = 'A'; //Single letter

testScore = 95; //Whole number value

classTestAverage = 88.4f; //Decimal number, notice the 'f' at the end

colorCode{

Green = 1,

Yellow = 5,

Red = 10

} gradebookColor; //Stores list of values

gradebookColor = Green; //This line does not need a declaration, it was declared in the line above

isStudentPassing = true; //Could be true or false

cout << "The class average is currently "

<< classAverage

<< endl;

cout << "The class test average was "

<< classTestAverage

<< endl;

cout << "Your test score was "

<< testScore

<< endl;

cout << "Your current letter score is "

<< letterScore

<< endl;

cout << "The color of your gradebook entry is "

<< gradebookColor

<< endl;

cout << "Are you passing? "

<< boolalpha //This line allows the word 'true' or 'false' to be printed instead of '0' or '1'

<< isStudentPassing

<< endl;

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions