I need help with computer lab

computer lab assignment. C++ please see below for more info. it will be a super quick one. scroll down to see the tasks. please copy the link u got from the task and past it in a word doc with the code u used under it. use this link to do the tasks http://cpp.sh/ In this lab you will become familiar with C++. This is intended for those who have little to no programming background. Any programming experience will make your life easier for sure. In the process you will: A program is just a list of instructions that a processor can execute. A processor takes each instruction from the list and executes it. Processors execute instructions like “store 1 in memory location 0x1234”. You can see below a list of instructions that go through a processor to be executed. A program needs to go from a text file to instructions that processors can use. The image below illustrates the C++ compilation process. The preprocessor applies some modifications to the original source code and then feeds it to the compiler. The compiler is just a program that given source code will output an object file. An object file is an intermediate step in the generation of an executable. A collection of object files (and external libraries) are put together by the linker to produce an executable. Your OS will load your executable via its loader and your program will then reside in memory. Lets start with the classical “Hello World” program. We will explain each line as we go through this lab. The source code is provided below. Try it out online here. The code above contains keywords such as int. You might have seen other keywords such as double and while. It also contains identifiers. Identifiers include variable names function names (such as main in the snippet above) among others. You can also see some literal values such as “Hello World”. These are constants that are specified in the code. You can also notice the punctuation used in the snippet. We use { } braces to delimit functions and code blocks. We also use ; at the end of some statements. In case you were wondering the << is an operator. Other operators such as + - % && and || are probably familiar to you. We are now going to go over each line in the snippet above. The first line starts with a # symbol. These lines are preprocessor directives. The #include tells the preprocessor to get the contents of the iostream file. Including iostream allows us to use the console for input and output. We then have int main() { ... }. This is the entry point to our program. All C/C++ programs need a main function that signals where the program begins. The curly braces encompass the instructions that are part of this function. In other words what goes inside the braces gets executed when the program starts running. We now face std::cout << "Hello World!n". The sequence of characters in between the quotation marks is called a string. We print to the console using cout << "Hello World!n". Here we are using the << operator. For now think of it as if "Hello World!n" is flowing into the consoles output. The n is an escape sequence that means new line. We havent mentioned std:: yet. The :: is called the scope resolution operator. In the snippet above it is basically telling the compiler to look for cout in the std namespace. A namespace is a way of organizing code into groups. The cout cin among other symbols are within that namespace. You need to prepend the std:: before any use of cout to let the compiler know where to find it. Lets try a different version of our "Hello World" program. Try it out online here. The only difference is that we now have this line using namespace std;. The program runs the same way but this time we dont need to prepend std:: before any cout or cin. This tells the program to look in the std namespace for any identifier that is not defined in our code. We finish the main function with a return 0. When a program finishes running successfully it returns a zero to tell the operating system that everything went alright. Returning other values than zero means that some error occurred. Dont worry about this yet it will be covered when we reach functions. For now just remember that the last line in your main function should be return 0. If you think of a sentence as a building block in the English language then you can probably relate to C++s statements. Statements are the fundamentals of code blocks and along with expressions they allow you to create complex programs. Expressions differ from statements because they evaluate to something. For instance 2 + 2 is an expression because it evaluates to 4. This resultant value is of a certain type. For instance in our 2 + 2 example the resultant value is the integer 4 which is represented by the int data type. We can also store characters such as a or 4. Notice that 4 is a number while 4 is a character. Characters are inside single quotes. You could also have decimal numbers such as 3.1416 and those belong to the double data type. There are different data types available for you in C++ and if you get bored you can even make your own! For now lets just list some common types: Storing an int in memory requires more memory than storing a char. Each data type has its own memory needs. char for instance requires 1 byte of memory. The int data type is typically 4 bytes long on most computers. A microcontroller however might allocate only 2 bytes for an int data type. So far we have talked about storing values in memory but we havent actually showed you how. In order to do this we are going to assign a name to a portion of memory and store a value of a specific data type in it. Creating that named portion of memory is called declaring a variable. Lets say that we want to store the value of our 2 + 2 expression. We would do so by first declaring a variable of int type. Declaring a variable is simple. Just write the data type you need to store followed by a whitespace and an identifier (i.e. a name). In the snippet above we declared a variable of type int named sum. We now have to set the value 2 + 2 in our variable. In the code above we are assigning the result of 2 + 2 to the variable sum. Now every time you use sum in your code you are using the result of 2 + 2 which is 4. Lets see a working example. Try it out online here. Programs would not be that useful if they could not take user input. In this section we use cin to capture user input from the console. To print to the console we used: To receive input we use: If you noticed we are using the >> operator when storing input. You can think of it as moving the console input to the variable userInput. Lets see a working example. Try it out online here. Programs execute the statements in order. Sometimes we wish we can alter the execution based on the circumstances. Control structures allow programs to decide whether to execute or not a group of statements and affect the programs control flow. In this section we are going to cover a simple conditional construct the if statement. In order to change the control flow of the program we must first test for a certain condition. For instance if the users input is less than 5 we might take route A otherwise we will take route B. This is illustrated in the flowchart below. If you need help understanding the flowchart symbols visit this site. As you could see we used a < sign to test whether the input was less than five. That symbol is an example of a relational operator. Sometimes you want to test for a more complex condition. Lets say we want to test for a number greater than 5 and less than 10. See the flowchart below. As you can see the condition has changed. It went from number < 5 to number > 5 && number < 10. The && (and) is a logical operator. The table below lists relational and logical operators. Evaluating a condition returns a value of true or false. These boolean values are of type bool. As expected you can create a variable that holds the result of a boolean expression as shown below. Lets now show you an example code for the flowchart above with the condition number > 5 && number < 10. Try it out online here. The only thing new in the code above if the use of the if statement. In order to create a valid if statement you need to follow this structure. Sometimes (as in the flowchart above) we want to do something if the condition is not true. In this case we have the if-else statement. We have three tasks to accomplish in this lab session. See some examples below: See some examples below: See some examples below: Requirements: 1 | .doc file Understand the basics of the C++ language. Understand the compilation process. Write the traditional "Hello World". Obtain input from the command line. Discuss some basic data types. int: Integer numbers. char: Characters or small integers. double: Decimal or floating-point numbers. Grade Curving: Write a program that outputs a students grade after computing a curve. The program will take as input a students grade and the curve that will be added to the grade. The program will also output the letter grade obtained by the student. Ascending Order: Write a program that inputs three integers from the keyboard and prints them in ascending order. Toll Payment: Create a program that takes as an input an integer that represents the number of miles driven by an user. The program should output the amount that the driver owes according to the number of miles driven. Use the table below to set prices.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!
Open chat
You can contact our live agent via WhatsApp! Via + 1 3234125597

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 20% with the discount code CLASS