Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Computer Problem Solving in EGR 1400, Engineering and Computer Science, 2023 — Exam 1 practice questions with completed solutions

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
25-02-2026
Written in
2023/2024

This document contains Exam 1 style multiple choice questions for EGR 1400 focused on introductory programming and problem solving in Visual C sharp. It covers core concepts like variables and data types, conditionals and logical operators, loops and counting iterations, parsing and formatting numbers, random number generation, and basic Windows Forms controls and events. The correct answers are provided throughout, with brief working shown for some loop questions. Ideal for reviewing key syntax patterns and common exam traps before an EGR 1400 Exam 1.

Show more Read less
Institution
Graduation In Computer Science
Course
Graduation in computer science

Content preview

COMPUTER-PROBLEM-SOLVING-IN -EGR-1400-EXAM-1-2023-WITH-COMPLETED-SOLUTIONS.
ENGINEERING-AND-COMPUTER-SCIENCE

1. Assume-that-x,y,-and-temp-are-integer-variables-and-x=5-and-y=8.-Which-of-the-
following-lines-of-code-swaps-the-values-of-x-and-y?

a.-x-=-y;
-y-=-x;
b.-temp-=-x;
-x-=-y;
-y-=-temp;
c.-x-=-temp;
-x-=-y;
-y-=-temp;
d.-x-=-y;
-temp-=-x;
-y-=-temp;---CORRECT-ANSWER-b.-temp-=-x;
-x-=-y;
-y-=-temp;

2. Consider-the-following-two-sets-of-code

(p)-if-((a-==-1)-&&-(b-==-1))
{
-txtBox.Text-=-"Hi";
-}

-(q)-if-(a-==-1)
-{
-txtBox.Text-=-"Hi";
-}
}

Which-one-of-the-following-statements-is-true?

a.-(p)-and-(q)-will-produce-different-outputs
b.-(q)-is-not-a-valid-set-of-Visual-C#-instructions
c.-The-two-sets-of-code-are-equivalent,-but-(p)-is-preferred-to-(q)-because-(p)-us-
clearer
d.-The-condition-statement-in-(p)-is-not-valid---CORRECT-ANSWER-c.-The-two-sets-
of-code-are-equivalent,-but-(p)-is-preferred-to-(q)-because-(p)-us-clearer

3. How-many-times-does-the-MEssage-Box-get-executed-in-a-loop-that-begins-with-
the-following-statement?-Assume-i-is-declared-by-int-i;
for-(i-=-1;-i-<=-1;-i++)

, COMPUTER-PROBLEM-SOLVING-IN -EGR-1400-EXAM-1-2023-WITH-COMPLETED-SOLUTIONS.
ENGINEERING-AND-COMPUTER-SCIENCE

{
-x-=-x-+-2;
//this-is-the-sum,-count-here
}

a.-0
b.-2
c.-3
d.-1
e.-None-of-these---CORRECT-ANSWER-d.-1

4. How-many-times-will-the-following-sum-execute?-(x-starts-at-0-with-int-x-=-0;)
while-(x-<-8)
{
-x-=-x-+-2;-
//This-is-the-sum,-count-here
}

a.-0
b.-4
c.-5
d.-6
e.-None-of-these---CORRECT-ANSWER-b.-4

Start-w/-0
2
4
6
8

5. In-C#,-you-can-simulate-rolling-two-dice-by-selecting-a-random-number-between-
1-and-6-to-represent-each-die-roll-and-then-adding-them-together-to-get-the-dice-
total.-Let,s-say-that-we-developed-a-program-to-do-this-and-we-rolled-the-pair-of-
dice-50-times-and-recorded-the-results-of-each-roll-on-a-sheet-of-paper.-Can-we-
just-select-one-random-number-between-2-and-12-and-achieve-the-same-
experimental-results-for-the-50-rolls-as-rolling-two-die-and-adding-them?

a.-No,-It's-not-possible-to-get-the-same-experimental-results-with-one-random-number
b.-Yes,-using-the-same-scaling-as-before
c.-Yes,-if-the-Visual-C#-code-is-written-to-scale-the-single-random-number-between-2-
and-12

Written for

Institution
Graduation in computer science
Course
Graduation in computer science

Document information

Uploaded on
February 25, 2026
Number of pages
7
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
STUVIAVERIFIEDEXAMS

Also available in package deal

Thumbnail
Package deal
EGR 1400 COMPLETE EXAM PACKAGE
-
3 2026
$ 19.38 More info

Get to know the seller

Seller avatar
STUVIAVERIFIEDEXAMS Oakland University
View profile
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
6 months
Number of followers
0
Documents
40
Last sold
2 months ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions