I have a problem in looping

closed account (48T7M4Gy)
Please use code tags <> on the toolbox on the right hand side.

Also after you've done that try and help is help you and be a bit more specific about what the problem is and whereabouts in your program we should start looking.

Comments like
The other loops are working but not the TV.
are not very helpful. What is the TV? What is it doing that makes you think it is doing 'it' wrong?
Make 2 posts :+)
closed account (48T7M4Gy)
So the code above doesn't include the TV problem area?
Crikey!!

Some things to help readability on this site:

Change the settings on your editor, so that tabs are converted to 3 spaces say - it will display much better.

There is no need to have massive cout statements, you can split them up, you have \n in them already, so use that as a guide. At the moment your code is 4 screens wide on my display.

Try to make use of functions, nesting those switch statements makes the code hard to understand.
closed account (48T7M4Gy)
.
Last edited on
No need to give up though :+)

Have a go at the advice we are giving you.

It's not or shouldn't be hard to change the settings on your editor.

To split up the cout statements:

1
2
3
4
5
std::cout<<"\nSUHD: \n(1)4K SUHD JS9500 Series Curve Smart TV-65inch class \n";
std::cout<<"(2)4K SUHD JS9100 Series Curve Smart TV-78inch class \n";
std::cout<<"(3)4K SUHD JS9000 Series Curve Smart TV-65 inch class \n";
std::cout<<"(4)4K SUHD JS9000 Series Curve Smart TV-48 inch class \n";
std::cout<<"(5)4K SUHD JS86000 Series Smart TV-78 inch class : ";


http://www.cplusplus.com/doc/tutorial/functions/


With the functions, you need functions for each menu (the cout statement above should be in a function), and functions for each menu item. In other words, each case should call a function.

Good Luck !!
closed account (48T7M4Gy)
Cheers :)
Last edited on
Topic archived. No new replies allowed.