NIU CSCI 240 Exam 2 MC Questions and Correct Verified Answers Latest Version
2 views 0 purchase
Course
NIU CSCI
Institution
NIU CSCI
Write a complete function called calcTriArea that will calculate and return
the area of a triangle. It takes two float/double values: the base and height
as its arguments. The area of a triangle is one-half the base times the height.
double calcTriArea(double base, double height)
{
re...
NIU CSCI 240 Exam 2 MC Questions
and Correct Verified Answers Latest
Version
Write a complete function called calcTriArea that will calculate and return
the area of a triangle. It takes two float/double values: the base and height
as its arguments. The area of a triangle is one-half the base times the height.
✓ double calcTriArea(double base, double height)
✓
✓ {
✓
✓ returns .5* base* height;
✓
✓ }
Write a complete function called findLarge that will return the larger of two
integers. It takes two integers (the values to be compared) as its arguments.
✓ the ASCII value of the character will be displayed
Write a cout statement to display the ASCII value of the character stored in a
char variable called ch. Assume that ch has been properly declared and
contains a value.
✓ cout<<(int)ch;
Write a switch statement to print out a string depending on the value of a char
variable called ch. If
ch is 'a' print "excellent"
Master01 | September, 2024/2025 | Latest update
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller ExamArsenal. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.49. You're not tied to anything after your purchase.