Purchase Solution

C++ Programs: Loops, Input Detection

Not what you're looking for?

Ask Custom Question

Need programs that fulfill the requirements in attached document.

Write a method called check Value that will meet the following criteria:
- Initializes total both to the default initialization value.
- Get input for the starting number (assume important statement is already present)
- Set total to the input above.
- Utilize a counter controlled loop to loop 10 times.
- Increment total by 2 for each loop iteration
- Return True if total is greater than 50.
- Return False if total is less than or equal to 50.

Write a method called check Value that will meet the following criteria:
- Receives a character as an argument
- Utilizes a switch statement utilizing above character
- Prints >=90 if character is either a or A
- Prints 80-89 if character is either b or B
- Prints 70-79 if character is either c or B
- Prints 60-69 if character is either d or D.
- Prints <60 for all other characters.
- Method does not return anything

Purchase this Solution

Solution Summary

Programs that fulfill specifications attached.

Solution Preview

Please see the attachment.
(I write the two programs in C/C++)

// 206437_q1.cpp

#include <stdio.h>

bool checkValue() {
float total = 0.0; // Initialize total to a default value 0
float startNumber;

// Get input for the starting number
printf("Input a start number: ");
scanf("%f", &startNumber);

// Set total to the startNumber;
total ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.