473,385 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Lowest grade. I am having a problem with getting the Lowest grade code to work.

Expand|Select|Wrap|Line Numbers
  1. #include<iostream>
  2.    using namespace std;
  3.  
  4.    int main()
  5.    {
  6.  
  7.    int midterm_grade, project_ave, homework_ave;
  8.     int average;
  9.  
  10.       cout <<"Please enter your midterm grade:\n";
  11.       cin >> midterm_grade;
  12.  
  13.       cout <<"Please enter your project average:\n";
  14.       cin >> project_ave;
  15.  
  16.       cout <<"please entry your homework average:\n";
  17.       cin >> homework_ave;
  18.  
  19.  
  20.     if (midterm_grade > project_ave && midterm_grade > homework_ave)
  21.          cout << "Highest Grade is  :" << midterm_grade << endl;
  22.  
  23.     else if (project_ave > homework_ave)
  24.          cout << "Highest Grade is:" << project_ave <<endl;
  25.  
  26.     else 
  27.          cout << "Highest Grade is:" << homework_ave<<endl;
  28.  
  29.  
  30.     if (midterm_grade < project_ave && midterm_grade > homework_ave)
  31.          cout << "Lowest Grade is  :" << midterm_grade << endl;
  32.  
  33.       else if (project_ave < homework_ave)
  34.          cout << "Lowest Grade is:" << project_ave <<endl;
  35.  
  36.       else 
  37.  
  38.          cout << "Lowest Grade is:" << homework_ave<<endl;
  39.  
  40.  
  41.  
  42.       average = ((midterm_grade *0.20) + (project_ave *0.40)  + (homework_ave*0.15 )) /3 ;
  43.                       cout << "Your current average is:" << average<< endl;
  44.  
  45.  
  46.  
  47.         if (average < 0.70)
  48.                         cout << "You have a grade below 70% on the midterm, project, and Homework" << endl;
  49.  
  50.         else
  51.         {
  52.             cout << "All three of your grades are passing" << endl;
  53.             }
  54.  
  55.  
  56.       return 0;
  57.         }
I am having a problem with getting the Lowest grade to work.
May 18 '13 #1
2 1173
divideby0
131 128KB
Expand|Select|Wrap|Line Numbers
  1.  if (midterm_grade < project_ave && midterm_grade > homework_ave)
  2. cout << "Lowest Grade is :" << midterm_grade << endl;
midterm_grade < homework_ave
May 18 '13 #2
weaknessforcats
9,208 Expert Mod 8TB
gneisler
Please use code tags. I have added them for you in your original post.
May 18 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Richard L Rosenheim | last post by:
I downloaded the ".NET Client Applications: .NET Application Updater Component" article by Jamie Cool along with the .Net Application Updater component, and I'm trying to get it to work. I...
1
by: Dave Brown | last post by:
Hi All, Trying to get a simple query going using group by and order by I need to retrieve the latest record ordered by datetimestamp desc but grouped by my nodeID column... my data is thus;...
1
by: Simon Harvey | last post by:
Hi chaps, I've made a pretty simple service in c# using VS.net. It compiles correctly and I've followed what little documentation there is to create a setup project in order to install the...
1
by: new to VC++ | last post by:
i've been developing code in turbo C++ in a DOS based environment . Now that i've finally shifted to Visual C++ , i really can't get my old programs to work . I realised everything has changed ....
1
by: Alan Silver | last post by:
Hello, I am just converting one of my pages from code-beside to code-behind. I removed all the C# and put that in a separate file (Basket.cs) and added references for all the ASP controls on the...
6
by: Ken Varn | last post by:
I have an ASP.NET application that is calling a custom class that is trying to parse all of the members of my Page object using Type.GetMembers(). The problem that I am having is that private...
2
by: gnrdtud | last post by:
I'm trying to teach myself how to use CSS to create site layouts. I've got a mock up of a really basic site, and through a lot of trial and error i've managed to get a working layout... in FF. IE6,...
10
by: jonathan184 | last post by:
Hi I tried getting this to work through dreamweaver but it did not. So i found a n example on the internet , i followed everything exactly the search script does not work. Could somebody help me...
2
by: Ice9Sysop | last post by:
Hello all, I am using a script to try to send an email from a we form. The script is as follows: <?php $name = $HTTP_POST_VARS; $email = $HTTP_POST_VARS; $phone = $HTTP_POST_VARS;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.