Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

puzzle - expected `;' before "pennies"? C++ Debugging (Code Completed) -


can tell me why error on last cout?

#include <iostream> #include <cmath> #include <stdio.h> #include <cstring> #include <conio.h>  using namespace std; inline void keep_window_open() { char ch; cin>>ch; }  int main() {  cout << "how many pennies have?\n";  int pennies;  cin >> pennies;  double total_pen;  total_pen = (0.01 * pennies);            if (pennies >= 1)            {                        string penn = " pennies.";            }else            {                        string penn = " penny.";  } cout << "how many nickles have?\n";  int nickles;  cin >> nickles;  double total_nic;  total_nic = (0.05 * nickles);            if (nickles >= 1)            {                        string 5 = " nickels.";            }else            {                        string 5 = " nickel.";  } cout << "how many dimes have?\n";  int dimes;  cin >> dimes;  double total_dim;  total_dim = (0.10 * dimes);            if (dimes >= 1)            {                      string ten = " dimes.";            }else            {                      string ten = " dime.";   } cout << "how many quarters have?\n";  int quarters;  cin >> quarters;  double total_qua;  total_qua = (0.25 * quarters);            if (quarters >= 1)            {                         string twentyfive = " quarters.";            }else            {                         string twentyfive = " quarter.";  } cout << "how many half-dollars have?\n";                int half_dollars;  cin >> half_dollars;  double total_dol;  total_dol = (0.50 * half_dollars);            if (half_dollars >= 1)            {                          string fifty = " half dollars.";            }else            {                         string fifty = " half dollar.";            } string saying = "you have "; cout << saying pennies penn << "\n" << saying nickles 5 << "\n" << saying dimes ten << "\n" << saying quarters twentyfive << "\n" << saying half_dollars fifty << "\n";  keep_window_open() return 0; } 

add more <<:

cout << saying << pennies << penn << "\n"       << saying << nickles << 5 << "\n"      << saying << dimes << ten << "\n"      << saying << quarters << twentyfive << "\n"      << saying << half_dollars << fifty << "\n";  

edit: also, declaring variables in inner blocks - names no longer valid outside. declare strings earlier.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -