Copy and paste the code

Assignment Help Basic Computer Science
Reference no: EM13161105

This lab introduces the logical operators AND, OR, and NOT in a menu driven application program.

  • Copy and paste the code below in a filename LastFirst_lab43.cpp (e.g. DoeJoe_lab43.cpp) and save it in Lab 4 folder.
  • Bring in the LastFirst_lab43.cpp program from the Lab 3 folder.
  • How could you rewrite gpa >= 2.0 in the first if statement using the NOT operator?
  • Could you replace year !='4' in the else if statement with year < 4 or year <= 3? Why or why not?
  • Take a screen shot of the output. Save it in a filename LastFirst_lab43.doc (e.g. DoeJoe_lab43.doc)
  • If you replace
if ( gpa >= 2.0 && year == '4') with if ( gpa >= 2.0 || year == '4') and 
replace else if ( year != '4'|| gpa < 2.0) with 
else if ( year != '4' && gpa < 2.0)  which students 
will graduate and which will not graduate  according to 
this new program? Does this handle 
all cases (i.e., all combinations of year and gpa)? 
  • Take a screen shot of the output. Insert it in LastFirst_lab43.doc.
  • Could you replace else if ( year != '4'|| gpa < 2.0) with the single word else?
  • Take a screen shot of the output. Insert it in LastFirst_lab43.doc.
  • Submit both the revised LastFirst_lab43.cpp and LastFirst_lab43.doc by uploading them here.

The following is the code to be used:

#include <iostream> 
using namespace std; 
int main() 
{ 
char year; 
float gpa; 
cout << "What year student are you ?" << endl; 
cout << "Enter 1 (freshman), 2 (sophomore), 3 (junior),
 or 4 (senior)" << endl << endl; cin >> year; 
cout << "Now enter your GPA" << endl; 
cin >> gpa; 
if (gpa >= 2.0 && year == '4') 
cout << "It is time to graduate soon" << endl; 
else if (year != '4'|| gpa <2.0)
 cout << "You need more schooling" << endl; 
return 0; 
}

Reference no: EM13161105

Questions Cloud

What is the background information on the environment : what is the background information on the environment.
What maximum pressure in atm could a balloon be filled : used to fill a weather balloon in order to lift equipment into the stratosphere. To what maximum pressure (in atm) could a 271 L balloon be filled?
Describe how uncoupling proteins work : describe how uncoupling proteins work, including their effectson cellular respiration. Explain how these proteins might play a role inthermogenesis and the control of reactive oxygen species such as superoxide.
Explain the process of glycolysis and its role : Can someone please explain the process of glycolysis and its role in cellular respiration?
Copy and paste the code : Copy and paste the code below in a filename LastFirst_lab43.cpp (e.g. DoeJoe_lab43.cpp) and save it in Lab 4 folder. Bring in the LastFirst_lab43.cpp program from the Lab 3 folder.
In neutrophils what organelle is represented as neutral : In neutrophils what organelle is represented as neutral stainedgranules?
Indicators of measurement and performance : The Concept of a balance scorecard is the topic. While there is not necessarily one best way to view a balance scorecard, clearly the good indicators of measurement and performance go beyond financial perspectives.
State what is the final pressure of the whole system in atm : the third bulb has a volume of 30.0 mL and contains 4.96 atm of hydrogen. If the stopcocks (valves) that isolate all three bulbs are opened, what is the final pressure of the whole system in atm?
What is the purpose of coronary arteries : How would an occlusion in a coronary artery affect blood flow tothe surrounding tissues?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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