Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

C++ for Everyone, Horstmann - Solutions, summaries, and outlines. 2022 updated

Beoordeling
-
Verkocht
-
Pagina's
1052
Cijfer
A+
Geüpload op
15-02-2022
Geschreven in
2021/2022

Description: INCLUDES Some or all of the following - Supports different editions ( newer and older) - Answers to problems & Exercises. in addition to cases - Outlines and summary - Faculty Approved answers. - Covers ALL chapters.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

CHAPTER 1: SOLUTIONS TO REVIEW EXERCISES


Solution R1.1: Using a computer does not require any advanced know-how or skill. Most
people are capable of turning a computer on and executing a program (such as double
clicking on the icon for Microsoft Word to bring up the word processor to type a letter).
Programming a computer, however, requires very specific knowledge. You must know the
rules of the programming language, and you must know how to construct a program.




Solution R1.2: Both program code and data are typically stored long term in a computer’s
secondary storage, such as a hard disk. Secondary storage is relatively inexpensive and
retains information even if the computer’s power is turned off. In addition to a computer’s
secondary storage, program code and data can also be stored in a computer’s primary
storage. Primary storage consists of read-only memory (ROM), which holds programs that
must always be present (such as the computer’s operating system), and random access
memory (RAM), which can hold changing data and programs that are currently executing.
RAM is relatively expensive when compared to secondary storage, and is erased whenever
the computer is turned off.




Solution R1.3: The user of a computer receives information from the computer’s display
screen, speakers, and printers (the computer’s output devices). The user can input data
using the computer’s keyboard, a pointing device such as a mouse, a microphone, or a
webcam (the computer’s input devices).




Solution R1.4: A simple cell phone that can only be used to make calls would be a single-
function device. If you can download programs (such as media players, web browsers, and
games) to the cell phone and execute them, then it would be considered a programmable
computer, as it can serve multiple purposes.




Solution R1.5: One advantage of C++ over machine code is that C++ statements are
independent of the machine (computer) they are being executed on; machine code

,statements differ from one type of machine to the next. Another advantage of C++ is that it
is much more readable and understandable (by humans) than machine code.




Solution R1.6: The hello.cpp file that I created was found in the following folder on my
computer. The location will vary from machine to machine.



C:\Documents and Settings\Jonathan\My Documents\Visual Studio 2005\
Projects\Hello\Hello



The iostream file was found in the following folder on my computer. The location will vary
from machine to machine.



C:\Program Files\Microsoft Visual Studio 8\VC\include




As you can see, the location of the files on my computer shows that the computer I use has
the Microsoft Visual Studio development environment installed on it.




Solution R1.7: The program prints the following:



6 * 7 = 42




Solution R1.8: The program prints the following:



HelloWorld

,Solution R1.9: The program prints the following:



Hello

World




Solution R1.10: Programs 1 to 3 below each have a different compile-time error (an error
that violates the rules of C++). Program 4 has a run-time error (an error that will allow the
program to execute, but which fails to provide the correct results).



Program 1 (compile-time error – no end quote on string):



#include <iostream>

using namespace std;



int main()

{

cout << "Hello, World! << endl;

return 0;

}



Program 2 (compile-time error – no semicolon on the cout statement):



#include <iostream>

using namespace std;

, int main()

{

cout << "Hello, World!" << endl

return 0;

}



Program 3 (compile-time error – no parentheses for main function):



#include <iostream>

using namespace std;



int main

{

cout << "Hello, World!" << endl;

return 0;

}



Program 4 (run-time error – “World” is misspelled):



#include <iostream>

using namespace std;



int main

{

cout << "Hello, Wolrd!" << endl;

return 0;

}

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
15 februari 2022
Aantal pagina's
1052
Geschreven in
2021/2022
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€36,37
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
TestBanks2022 Harvard University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
2174
Lid sinds
4 jaar
Aantal volgers
1702
Documenten
2238
Laatst verkocht
3 dagen geleden

4,0

351 beoordelingen

5
191
4
59
3
45
2
18
1
38

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen