Programming in c++

Assignment Help Basic Computer Science
Reference no: EM13831367

Programming in C++

Loops and DecisionsPart A

Explain the difference between:

s = 0;

If (x > 0) s++;

If (y > 0) s++;

and

s = 0;

if (x > 0) s++;

else if (y > 0) s++;

Part B

What are the values of s and n after the following loops?:

a. int s = 1;

    int n = 1;

    while (x < 10) 

    s = s + n;

    n++;

b. int s = 1;

    int n;

    for (n = 1; n < 5; n++)

        s = s + n;

c. int s = 1;

    int n = 1;

    do

    {

        s = s + n;

        n++;

    }

    while (s < 10 * n);

Part C

Write a program that accepts four grades, calculates the average of the four grades, and then converts the average from a number grade into a letter grading using the following grading scale: 

A  100 - 90

B   89 - 80

C   79 - 70

D   69 - 60

F   59 - 0

Output the final grade average along with the letter grade.

Reference no: EM13831367

Questions Cloud

How steel and computer industry have used adaptation theory : Prepare a report using the Theory relating to Adaptation, Aggregation and Arbitrage to explain how companies from the following industries have used this theory for the pursuit of their businesses.
Windows word is an example : Windows Word is an example of System software. Platform software.
How would the line be balanced : The cycle time is determined to be 1.5 minutes. how would the line be balanced by choosing the assignable task hang the longest task time first?
Whose trademark is the operating system unix : Whose trademark is the operating system UNIX? A.Motorola B.Microsoft C.BELL Laboratories D.AshtonTate
Programming in c++ : Programming in C++ Loops and DecisionsPart A Explain the difference between: s = 0; If (x > 0) s++; If (y > 0) s++;
Identify a subset of customers : Having had success using customer data to build predictive models to guide direct mail campaigns for special plumbing offers, he considers that data mining could help him to identify a subset of customers who should be good prospects for his new s..
Design a flowchart or pseudocode for a program : Chocolate Delights Candy Company manufactures several types of candy.  Design a flowchart or pseudocode for a program that accepts a candy name (for example, "chocolate-covered blueberries"), price per pound, and number of pounds sold in the average ..
How is project management important in operations management : How is Project Management important in Operations Management? How is using PM tools beneficial in a professional life? In project planning, why is it important for a team to have clear understanding of goals and scope?
Services marketing-pricing concepts : This discussion helps you develop the skills to master the following course competencies:

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Design an asynchronous base 14 counter

Design an asynchronous base 14 counter that counts through the natural binary sequence from 0 (0000) to 13 (1101) and then returns to zero on the next count.

  Role of it in the contemporary business organization

Understand the central role of IT in the contemporary business organization. Understand the impact of the World Wide Web on the management of business

  Write a program segment that translates an integer value

Write a program segment that translates an integer value into a letter grade. Between 90 and 100 the segment should output 'A', between 80 and 89 it should output 'B', between 70 and 79 it should output 'C', between 60 and 69 it should output 'D' ..

  Class to describe the product

For this assignment, you will create a class to describe the product that is being ordered. You will then modify your code to create an instance of this class and utilize it in the ordering process.

  Managing organizational risk

No longer than a decade ago, IT security professionals had to work hard to persuade organizational leaders about the importance of developing effective risk management plans. Nowadays, due to the plethora of cautionary tales that organizations histor..

  What will be the eventual proportion of the bandwidth

Assume that the queue size is infinite without buffer overflow (no packet loss), and the maximum window of the TCP sender is 20 packets, with each packet having 1500 bytes.

  Calculate and display the total retail value of all products

It should calculate and display the total retail value of all products sold. Use a sentinel-controlled loop to determine when the application should stop looping display the final results.

  Write a simple atm program in python

Write a simple atm program in Python. Ask the user to enter their account number, and then print the beginning balance.

  Contemporary enterprises have a wide array of network

Contemporary enterprises have a wide array of network and platform security tools from which to choose, and as we have seen in this course there is substantial overlap in the capabilities of different categories of tools such as firewalls, IDS, anti-..

  Write a function oriented program to compute the compound

How is pass by reference implemented in the program. Write a function oriented program to compute the compound interest for the sum invested for any number of years using the concept of pass by value.

  Design patterns in today-s development environments

In System Analysis and Design: Design Patterns - How widely used are design patterns in today's development environments?

  Represent processor demand in the time interval

Let the function D[i, j] represent processor demand in the time interval (i, j). Prove the following theorem.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd