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

COMM 205 Midterm Concordia University trial exam solution

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
12-02-2024
Written in
2023/2024

COMM 205 Midterm Concordia University trial exam solution

Institution
Course









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

Written for

Institution
Study
Unknown

Document information

Uploaded on
February 12, 2024
Number of pages
10
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COMM 205 Midterm Concordia University trial exam solution
1. A company purchases notebook and tablet computers for its operations for set prices.
Notebooks cost $1,100 and the tablets cost $450. Write a code fragment that takes the
number of notebooks and tablets as inputs and computes the total cost. The inputs are
provided through the textboxes txtNotebooks and txtTablets. The output should be displayed
in lblTotal. (10 points)

double txtNotebooks, txtTablets, total;

txtNotebooks = 1100;
txtTablets 450;

lblTotal.Text = total.ToString();

2. decimal a = 10m;
double b = a;
The above code has a problem. To correct it you need to usea.
Try-catch
b.
TryParse()
c.
Math class
d.
Casting


3. Which of the following conditions checks if price is between $10 and $20 inclusivelya.
price >= 10 || price <=20;
b.
price >= 10 && price <=20;
c.
20 >= price >= 10;
d.
10 <= price <= 20;

, The switch statement has the following structure:
switch (test variable or expression)
{
case value_1: …
case value_2: …
}
The valid types of test variable (or expression) include all of the
following, except:



a.
string
b.
double
c.
char
d.
int


If quantity has a value of 5, what is the value of discount after these statements are
executed?
switch (quantity) {
case 1: discount = 0; break;
case 2:
case 3:
discount = .1; break;
default:
discount = .2; break;
}

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.
smartzone Liberty University
Follow You need to be logged in order to follow users or courses
Sold
3198
Member since
5 year
Number of followers
2291
Documents
14397
Last sold
2 days ago
AMAIZING EDUCATION WORLD

GET ALL KIND OF EXAMS ON THIS PAGE ,COMPLETE TEST BANKS,SUMMARIES,STUDY GUIDES,PROJECT PAPERS,ASSIGNMENTS,CASE STUDIES, YOU CAN ALSO COMMUNICATE WITH THE SELLER FOR ANY PRE-ORDER,ORDER AND ETC.

3.7

584 reviews

5
260
4
93
3
103
2
29
1
99

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