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)

CS 158/159 Midterm Exam 1 -2022 Exam Questions and Answers

Beoordeling
-
Verkocht
-
Pagina's
11
Cijfer
A+
Geüpload op
19-04-2022
Geschreven in
2021/2022

CS 158/159 Midterm Exam 1 -2022 Exam Questions and Answers

Instelling
Vak

Voorbeeld van de inhoud

CS 158/159 Midterm Exam #1
35 Questions * 3 Points Each = 105 Points
Any points earned beyond 100 are considered extra credit.




Exam Rules/Notices:

1. Do not fill in the section or the test form. Fill in your name and your student ID# on the answer sheet (write it in
AND fill in the bubbles). An incorrect student ID number will result in a zero for this exam.
2. Make sure you have all 35 questions to this exam. You should answer every question. All questions only have
one best answer. Please be careful when filling in your answers, any answer determined to be unreadable by
Instructional Data Processing will be considered incorrect. Only the answer on your answer sheet can be
considered when grading. An operator precedence table and ASCII table are provided on the back of this exam.
3. NO QUESTIONS WILL BE ANSWERED DURING THE EXAM. We do not answer questions during the
exam due to the limited number of staff members present. It is easier for us to “throw out” a test question with an
error than it is to answer questions or to make an announcement during the examination period. Manage your
time accordingly!
4. You must assume that all C programs and code segments are implemented on the guru.itap machine and
would be compiled with the gcc compiler as set up during the first week of the semester. When segments of
code are presented you may assume that the appropriate include statements are present and that the code would be
inside of a fully operational function or program.
5. Protect your work and keep your focus on your own exam. It is considered dishonest if you copy from
another student or to permit another student to copy from you. If a spotter has any reason to suspect questionable
behavior, you may be asked to move to another seat. Anyone found to violate course policies will receive a
failing grade for the course and will be referred to the Office of the Dean of Students.
6. You are NOT permitted to use any resources during this exam. This includes but is not limited to; texts,
notes, calculators, cell phones, MP3 players, and computers. If your cell phone audibly rings during the exam
you will be required to immediately submit your exam and leave the testing facility.
7. When you are finished with the exam, please proceed back to the lobby to submit your answer form and to exit
the facility. You will be required to show photo identification before we can accept your work. You will
keep this exam form. You may not return to your seat once you have submitted your exam.
8. Your score (and exam answers) will appear on Blackboard as soon as possible. Do not contact course staff
members about mistakes (if any) until answers are posted.
9. When time is called ALL writing must stop. You are not permitted to continue to make revisions to any answer
on your exam once time has been called.
10. Schedule reminders:
◦ There are no TA evening hours in SC 189 this evening.
◦ All lecture and lab sections are meeting this week! See your syllabus regarding how you will be compensated
for tonight's exam.

NO QUESTIONS WILL BE ANSWERED DURING THE EXAM.

, Use the example output below for problems 1 – 3
Enter the beginning balance: 15000
Enter the interest rate as a percentage: 3.75
Enter the value deposited at the end of each year: 500
Enter the desired ending balance: 22500

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Beginning balance: 15000 (USD)
Interest rate: 3.8%
Annual deposits of: 500 (USD)
Desired ending balance: 22500 (USD)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Number of years: 7
Actual ending balance after 7 years: $ 23328.52
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

1. Which of the following print statements would correctly display the desired ending balance as seen in the
example output provided above?
A) printf("Desired ending balance: %9d (USD)\n", end);
B) printf("Desired ending balance:%9d (USD)\n", end);
C) printf("Desired ending balance:%10d (USD)\n", end);
D) None of the above.

2. Which of the following print statements would correctly display the interest rate as seen in the example
output provided above?
A) printf("Interest rate: %17.1f%% \n", rate);
B) printf("Interest rate:%18.1f% \n", rate);
C) printf("Interest rate:%17.1f%% \n", rate);
D) None of the above.

3. Which of the following print statements would correctly display the actual ending balance as seen in the
example output provided above?
A) printf("Actual ending balance after %2d years: $%12.2f\n", terms, fnl);
B) printf("Actual ending balance after %2d years: $ %10.2f\n", terms, fnl);
C) printf("Actual ending balance after %2d years: $%11.2lf\n", terms, fnl);
D) None of the above.

Use the code segment below for problems 4 – 5
double x; 4. Which of the following is the first line of output
int y = 32; generated by the code segment on the left?
A) x: 0.0
x = pow(y, );
B) x: 1.0
y = (double) y / 3 + 0.5; C) x: 2.0
D) None of the above.
printf("x: %.1f\n", x);
printf("y: %.1f\n", (double) y);
5. Which of the following is the second line of output generated by the code segment above?
A) y: 11.0 C) y: 11.2
B) y: 11.1 D) none of the above.

Geschreven voor

Vak

Documentinformatie

Geüpload op
19 april 2022
Aantal pagina's
11
Geschreven in
2021/2022
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$15.49
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.
Examhack Stanford University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
301
Lid sinds
4 jaar
Aantal volgers
238
Documenten
999
Laatst verkocht
2 dagen geleden
EASY A GRADE!!

Here, you will find simple, articulate well-researched education material for you. .... ALL WORK HAS PASSED WITHOUT NEEDING REVISIONS AND BY THE RUBRIC.

3.8

61 beoordelingen

5
31
4
11
3
5
2
4
1
10

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