Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me about C++ program For example This program about insert number :

ID: 3579165 • Letter: P

Question

Please help me about C++ program For example This program about insert number : 1 2 3 4 5 when I input number 10 is show 1 2 3 4 5 10 when i input A is show the number incorrect my program when i input number 200A , it is show 200 but it had to show "Incorrect number , enter number again : " Please tell me how to deal with maybe use cin.clear() cin.get or
this my teacher' example
l


lsers SONY Desktop Spring 2016 corn 243 proje Projec nsert key Delete "Delete" key Sort "F2" key Select un Arrow key Move Right Right Arrow key Move Left "Left Arrow" key Exit "F1" key e CS151811 18 18 lease enter an integer: 18sisiasdas Input. Try agian: Sdas wrong input. Try agian! asidsasd wrong input. Try agian: asdi g input. Try agian: hrang input. Try agian 18dseA s input. Try agian

Explanation / Answer

Hi,

if you are using variable to get the input using cin function then try with data type as character type or array type.

you can get the input what ever you want. Thanks!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote