Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » "For" loop not working
icon8.gif  "For" loop not working [message #1725042] Mon, 29 February 2016 10:20 Go to next message
Von Braunn is currently offline Von BraunnFriend
Messages: 2
Registered: February 2016
Junior Member
For some reason, this program is not working properly.
With the help of the for loop, this program basically asks how many movie review's the user wants to write . But since the for loop is not working, the program terminates after the "Welcome to movie review's !" line is displayed. Any help is appreciated : ) !!!




#include <iostream>
#include <string>
using namespace std;
int main(){
int num , n;
num = n;


cout << " Welcome to movie review's ! " <<endl;


for ( num = n; n < 0 ; n = n - 1){

string movie = "";
cout << "Please enter the name of the movie : " << endl;
getline (cin,movie);

int r ;
cout << "Please enter the tomatometer rating (out of 100 %) : " << endl;
cin >> r ;

int m ;
cout << "Please enter the metascore (out of 100 % ) : " << endl;
cin >> m ;

int sum = r + m;
float average = sum /2;
float point = average / 10;
cout << " The movie average is : " << average << " % " << endl ;
cout << " So on a 10 point scale,the movie rating is : " << point << " /10 "<< endl;

return 0;

}
Re: &quot;For&quot; loop not working [message #1725072 is a reply to message #1725042] Mon, 29 February 2016 14:37 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

This isn't a general programming help forum. It's for helping you
install and use the Eclipse IDE. I would suggest posting on
stackoverflow.com or another site.
Previous Topic:Installation
Next Topic:Eclipse will not work
Goto Forum:
  


Current Time: Thu Apr 25 10:40:05 GMT 2024

Powered by FUDForum. Page generated in 0.07864 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top