100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

NIU CSCI 240 Exam 1 Study Guide Questions and Answers 100% Solved

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
24-12-2024
Written in
2024/2025

NIU CSCI 240 Exam 1 Study Guide Questions and Answers 100% Solved main() marks the beginning of a C++ program. What C++ reserved word precedes it? - int Most lines in a C++ program end with a - ; (semi-colon) According to the lecture notes, the two main conceptual components of a program are _____ and _____. - data and instructions Modify (rewrite) the following instruction so that the subtraction is evaluated first: i = a * b / c - d; - i= a*b/(c-d); About how many decimal places of accuracy does a float have? - 6 Suppose you have two integer variables (named num and sum) with valid values. Write a single cout instruction to display them as follows: num is __ sum is __

Show more Read less
Institution
NIU CSCI 240
Course
NIU CSCI 240










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
NIU CSCI 240
Course
NIU CSCI 240

Document information

Uploaded on
December 24, 2024
Number of pages
17
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

NIU CSCI 240 Exam 1 Study Guide

Questions and Answers 100% Solved


main() marks the beginning of a C++ program. What C++ reserved word

precedes it? - ✔✔int

Most lines in a C++ program end with a - ✔✔; (semi-colon)

According to the lecture notes, the two main conceptual components of a

program are _____ and _____. - ✔✔data and instructions

Modify (rewrite) the following instruction so that the subtraction is evaluated

first:

i = a * b / c - d; - ✔✔i= a*b/(c-d);

About how many decimal places of accuracy does a float have? - ✔✔6

Suppose you have two integer variables (named num and sum) with valid

values. Write a single cout instruction to display them as follows:



num is __

sum is __



1
©JOSHCLAY 2024/2025. YEAR PUBLISHED 2024.

,the underscore characters will show the actual values in num and sum - for

example:



num is 4

sum is 24 - ✔✔cout<<"num is 4"<<num<<endl<<"sum is 24"<<sum;

The formula for converting a Fahrenheit temperature to Centigrade is 5/9(F

- 32). What is wrong with writing it in C++ as




C = 5/9 * (F - 32);




assuming that C and F are both declared as doubles, and F has a valid

value. - ✔✔What's wrong with it is you're always going to get 0 because it

is integer division and 5 does not go into 9 evenly. You can fix it by

typecasting or writing 5.0/9 (that will give you the remainder).

About how many decimal places of accuracy does a double have? - ✔✔12

What instruction will display data on the screen from a C++ program? -

✔✔cout



2
©JOSHCLAY 2024/2025. YEAR PUBLISHED 2024.

, Name two libraries that should be #include'd at the top of a C++ program. -

✔✔#include <iostream>

#include <iomanip>

Explain in detail what the following instruction does (assuming i is declared

as int):



cin >> i; - ✔✔The code above states that there will be a value inputed

(allows the user to input a value)/ associated with i later on. For example it

could be used in a way such as i++, if the input value of i is 1 the ++ will

incrementally increase i by 1 thus making i 2.

Select the three control structures that (along with sequence) will be

studied in this course. - ✔✔int

decision

repetition/looping

#include

branch and return/function calling

Name the 3 C++ statements used to create a loop. - ✔✔while

for

do while


3
©JOSHCLAY 2024/2025. YEAR PUBLISHED 2024.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
JOSHCLAY West Governors University
View profile
Follow You need to be logged in order to follow users or courses
Sold
214
Member since
2 year
Number of followers
14
Documents
17198
Last sold
5 hours ago
JOSHCLAY

JOSHCLAY EXAM HUB, WELCOME ALL, HERE YOU WILL FIND ALL DOCUMENTS &amp; PACKAGE DEAL YOU NEED FOR YOUR SCHOOL WORK OFFERED BY SELLER JOSHCLAY

3.6

42 reviews

5
16
4
7
3
9
2
5
1
5

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions