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

  Find the gradient magnitude and gradient direction

Consider the sub-image shown above. Find the gradient magnitude and gradient direction at the center entry using the following operators.

  Why analyst needs to understand how people think

Describe why an analyst needs to understand how people think, how they learn, how they react to change, how they communicate, and how they work.

  Develop requirements traceability matrix

The GlobalUBid.Com Case Study will be used to develop a requirements traceability matrix describing and following the life of requirements in both the forward and backward direction.

  Calculate roots of function by newton-raphson approximation

Best known iterative method for calculating roots of a function f (that is, x-values for which f(x) is 0) is Newton-Raphson approximation.

  Staffing level requirements for project team

Describe in scholarly detail how you would use WBS as aid to finding staffing level requirements for project team?

  Explain ibm plan to give its it assets-intellectual property

Will IBM's plan to give away some of its IT assets and intellectual property also increase its support of open-source software products like Linux.

  Differentiating conventional decision support system and es

A major difference between a conventional decision support system and an ES is that the former can explain a "how" question whereas the latter can also explain a "why" question.

  Research various types of hard drives available from online

Research the various types of hard drives available from online and/or local retail computer stores.Make a chart of several different brands or models of 1 TB desktop hard drives.

  Government regulation in bio-engineered products

When it comes to the food industry and the bio-engineered products, is there such a thing as too much government regulation?

  Significant difference of typical salary for system analyst

Is there a significant difference between typical salaries for system analyst, designers, and developers? What is the difference between typical salaries for these different groups?

  Explain cyberspace arena for human social interaction

Do you believe cyberspace is a whole new arena for human social interaction, or is it simply one more tool which humans put to remarkable range of uses without actually changing in any fundamental way?

  Explaining data visualization form of business intelligence

Is data visualization a form of business intelligence? Describe why or why not? What security issues are related with data visualization?

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