Adelolaa's Posts
Nairaland Forum › Adelolaa's Profile › Adelolaa's Posts
1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 (of 29 pages)
still waiting for d right owner ![]() |
ganex: pl which app is de best for battery saver.DX toolbox |
cycamera work ![]()
|
c4droid, cc tools, droidEdit, etc.. |
/* write a program that ask the user to enter his or her age. then display the age in months */ #include <iostream> using namespace std; void age_in_month(int); int main() { int age; cout << "Enter your age: "; cin >> age; age_in_month(age); } void age_in_month(int initial) { int month = initial * 12; cout << initial << " year(s) of age(s) is " << month << " months"; } |
quadrangle: here is my code.nice work |
Kennybix: @ade, can you handle structures? You can use it to 'hold' fractions, and pass it as an argument to functions. It can even be used as a return type!thanks. I will use class |
working on calculator4.cpp what new: more math functions |
Kennybix: @adelolaa, you're running a nice thread o. I'm also a beginner, a lazy one though. Let's help each other out. A task for me plsu welcome but don't be lazy oooo ![]() |
// calculator3.cpp // update to calculator 2:: here // is loop calculator // this small calculator program // created by xarm™ #include <iostream> #include <string> using namespace std; void calculator_funct (double first_number, double second_number, string operation_type); void add_number(double x, double y); void multipl_number(double x, double y); void subtract_number(double x, double y); void divide_number(double x, double y); void invalid_input(); void wrong_denominator(); void re_used(); int main() { double first_number; double second_number; string operation_type; cout << "Enter the first number(numerator): "; cin >> first_number; cout << endl << endl; cout << "Enter the second number(denominator): "; cin >> second_number; cout << endl << endl; cout << "Enter the operation type(+,-,*,/): "; cin >> operation_type; calculator_funct (first_number, second_number, operation_type); re_used(); } void calculator_funct (double first_number, double second_number, string operation_type) { if (operation_type == "/" ) { if(second_number == 0) { wrong_denominator(); } else if (second_number !=0) { divide_number(first_number, second_number); } } else if (operation_type == "+" ) { add_number(first_number, second_number); } else if (operation_type == "-" ) { subtract_number(first_number, second_number); } else if (operation_type == "*" ) { multipl_number(first_number, second_number); } else if ((operation_type != "/" ) || (operation_type != "+" ) || (operation_type != "-" ) || (operation_type != "*" ) ) { invalid_input(); } } void add_number(double x, double y) { double result = x + y; cout <<endl << endl << "Additon of the two numbers is: " << result; } void multipl_number(double x, double y) { double result = x * y; cout <<endl << endl << "Multiplication of the two numbers is: " << result; } void subtract_number(double x, double y) { double result = x - y; cout << endl << endl << "Subtraction of the two numbers is: " << result; } void divide_number(double x, double y) { double result = x / y; cout << endl << endl << "Division of the two numbers is: " << result; } void invalid_input() { cout << endl << endl <<"Invalid input" << endl; } void wrong_denominator() { cout << endl << endl << "undefined! denominator can not be zero" << endl; } void re_used() { char re_use; double first_number; double second_number; string operation_type; cout << endl << endl << "Enter (y) to use again or (n) to quit: "; cin >> re_use; cout << endl << endl; while(re_use != 'n') { if (re_use == 'n') { cout << "Thank you for using my calculator"; break; } cout << endl; cout << "Enter the first number again (numerator): "; cin >> first_number; cout << endl << endl; cout << "Enter the second number again(denominator): "; cin >> second_number; cout << endl << endl; cout << "Enter the operation type again (+,-,*,/): "; cin >> operation_type; calculator_funct (first_number, second_number, operation_type); cout << endl << endl << "Enter (y) to use again or (n) to quit: "; cin >> re_use; cout << endl << endl; } cout << "thank you for using this calculator" << endl; } /** xarm™ Project © Dec. 2013 **/ |
just passing by with my surulere++ sha. #team_Tecno_m3 visit this for young c++ programmer https://www.nairaland.com/1536652/c-beginner-discussion-room-drop/3#20359305 |
// calculator2.cpp // update to first calculator program // this small calculator program // created by xarm™ #include <iostream> #include <string> using namespace std; void calculator_funct (double first_number, double second_number, string operation_type); void add_number(double x, double y); void multipl_number(double x, double y); void subtract_number(double x, double y); void divide_number(double x, double y); void invalid_input(); void wrong_denominator(); int main() { double first_number; double second_number; string operation_type; cout << "Enter the first number(denominator): "; cin >> first_number; cout << endl << endl; cout << "Enter the second number(denominator): "; cin >> second_number; cout << endl << endl; cout << "Enter the operation type(+,-,*,/): "; cin >> operation_type; calculator_funct (first_number, second_number, operation_type); } void calculator_funct (double first_number, double second_number, string operation_type) { if (operation_type == "/" ) { if(second_number == 0) { wrong_denominator(); } else if (second_number !=0) { divide_number(first_number, second_number); } } else if (operation_type == "+" ) { add_number(first_number, second_number); } else if (operation_type == "-" ) { subtract_number(first_number, second_number); } else if (operation_type == "*" ) { multipl_number(first_number, second_number); } else if ((operation_type != "/" ) || (operation_type != "+" ) || (operation_type != "-" ) || (operation_type != "*" ) ) { invalid_input(); } } void add_number(double x, double y) { double result = x + y; cout <<endl << endl << "Additon of the two numbers is: " << result; } void multipl_number(double x, double y) { double result = x * y; cout <<endl << endl << "Multiplication of the two numbers is: " << result; } void subtract_number(double x, double y) { double result = x - y; cout << endl << endl << "Subtraction of the two numbers is: " << result; } void divide_number(double x, double y) { double result = x / y; cout << endl << endl << "Division of the two numbers is: " << result; } void invalid_input() { cout << endl << endl <<"Invalid input" << endl; } void wrong_denominator() { cout << endl << endl << "undefined! denominator can not be zero" << endl; } |
// calculator.cpp // this small calculator program // created by xarm™ #include <iostream> // needed for input and output #include <string> // needed for string input using namespace std; double calculator_funct (double first_number, double second_number, string operation_type); // declare calculator function int main() { double first_number; // declare variable for numerator double second_number; // declare variable for denominator string operation_type; // declare variable for opration type cout << "welome to xarm™ Calculator" << endl << endl << endl; //print out welcome note cout << "Enter the first number(numerator): "; // ask for user first number cin >> first_number; // assign user value to this variable cout << "Enter the second number(denominator): "; // ask user for second value cin >> second_number; // assign user second value to this variable cout << "Enter the operation type(+,-,*,/): "; // ask for user operation type cin >> operation_type; // assign user operation type to this variable double answer = calculator_funct (first_number, second_number, operation_type); //calling calculator function cout << "Your answer is: " << answer << endl; //print out the user answer } double calculator_funct (double first_number, double second_number, string operation_type) //defination of calculator function { if (operation_type == "/" ) // testing if operation type is division { if(second_number == 0) // testing user second number { return 0; //if second is zero. print this } else if (second_number !=0) // testing if operation type is not zero { return (first_number / second_number); //print out division of the both numbers } } else if (operation_type == "+" ) // testing if operation type is plus { return (first_number + second_number); // print out if operation type is plus } else if (operation_type == "-" ) //testing if operation type is minus { return (first_number - second_number); // print this if condition meet } else if (operation_type == "*" ) // testing if user operation type is mult. { return (first_number * second_number); // print out if condition meet } // testing if user input wrong operation type else if ((operation_type != "/" ) || (operation_type != "+" ) || (operation_type != "-" ) || (operation_type != "*" ) ) { return 0; // print this of condition meet } } /******* END OF THE PROJECT. XARM™ © Dec. 2013 *******/ |
// Assignment::::: c++ // A red seed will grow into a flower // when planted in soil temperatures above // 75 degrees. Otherwise it will grow into // a mushroom. Assuming the temperature meets // the condtion for growing flower, planting // seed in dry soil will produce dandelion // and planting the red seed in wet soil will // produce sunflower. #include <iostream> #include <string> using namespace std; int main() { int temperature; string soil_type; cout << "Enter the soil temprature" << endl; cin >> temperature; if (temperature < 75) { cout << "Mushroom will grow" << endl; } else if (temperature > 75) { cout << "Enter the soil type (dry or wet)" << endl; cin >> soil_type; if (soil_type == "dry" ) { cout << " Dandelion will grow" << endl; } if (soil_type == "wet" ) { cout << "Sunflower will grow" << endl; } } } // update to the first one..... |
wisemania: ill strongly adise you get dis book, just 8.1mb....am currently using the C version....thanks |
raynold: i just finished writing this program in cnice work. time to move on to chapter six |
xxxtedyxxx: Nice one..u av done a great job. Dats gud. Saturday is stil quite far from now. So don't just hang in dere cos she said yes. Keep up wit her, till den..till dat very day. Check up wit calls n messages, wen chatting..u can talk abt d fun tins u r gona do togeda..n stuff like dat. Just make her more interested in d date..dat way..she won't flake wen saturday comes...thanks |
@ Op thanks. I asked the girl out to meet her again and she said yes. so we are meeting next Saturday. please I need some advice ![]() |
//solution to Q3 chapter 5 // write a program that compute a // running sum of inputs from the user, // terminate when the user gives an input // of zero (0) #include <iostream> using namespace std; int main() { long firstInput; long secondInput; cout << "Enter your numbers! (0 for both to quit)" << endl << endl; cout << "First number "; cin >> firstInput; cout << "Second number " ; cin >> secondInput; cout << "the sum of the both numbers is " << firstInput + secondInput << endl; while ((firstInput && secondInput) != 0) { if ((firstInput && secondInput) == 0 ) { cout << "Thank you!" << endl; break; } cout << "enter another numbers ( 0 for both to quit)" << endl; cout << "First number: "; cin >> firstInput; cout << "Second number: "; cin >> secondInput; cout << "the sum of the numbers is " << firstInput + secondInput << endl; } //accomplished } |
raynold: nice..thanks. I will drop solution to question 2 dis nite |
xxxtedyxxx: U need to switch ...and use diversion. Wen a girl is saying no no no..don't pressure her again. U don't av to get a yes from her before u can start acting like her bf. Forget abt her reply..and just u care, and make sure she is investing too, she will invest, wen she automatically start seeing dat caring bf potential in U.thanks |
screenshots
|
// solution to question 2 chapter five //write a menu program that let the user //select from a list of options, and if the //input is not one of the options, reprint //the list. #include <iostream> #include <string> using namespace std; int main() { string type = " "; cout << "Welcome to xarm softdrinks shop" << endl << endl; cout << "choose your order below! (a - n)" << endl << endl; cout << "a - Coca-Cola \t\t b - Sprite" << endl; cout << "c - Fanta \t\t d - Limca" << endl; cout << "e - Mountain Dew \t f - Pepsi" << endl; cout << "g - 7-Up \t\t h - Maltina" << endl; cout << "i - Mirinda \t\t j - Malta Guiness \t" << endl; cout << "k - Malt \t\t l - Amstel Malta \t" << endl; cout << "m - maltina" << endl << endl; cout << "Your order: "; getline (cin, type); while ((type != "a" ) || (type != "b" ) || (type != "c" ) || (type != "d" ) || (type != "e" ) || (type != "f" ) || (type != "g" ) || (type != "h" ) || (type != "i" ) || (type != "j" ) || (type != "k" ) || (type != "l" ) || (type != "m" ) ) { cout << endl; if ((type == "a" ) || (type == "b" ) || (type == "c" ) || (type == "d" ) || (type == "e" ) || (type == "f" ) || (type == "g" ) || (type == "h" ) || (type == "i" ) || (type == "j" ) || (type == "k" ) || (type == "l" ) || (type == "m" ) ) { cout << "Thanks! i will order that for you!" << endl; break; } cout << endl; cout << "Invalid order! " << endl << endl; cout << "Choose from a - m only " << endl << endl; cout << "a - Coca-Cola \t\t b - Sprite" << endl; cout << "c - Fanta \t\t d - Limca" << endl; cout << "e - Mountain Dew \t f - Pepsi" << endl; cout << "g - 7-Up \t\t h - Maltina" << endl; cout << "i - Mirinda \t\t j - Malta Guiness \t" << endl; cout << "k - Malt \t\t l - Amstel Malta \t" << endl; cout << "m - maltina" << endl << endl; cout << "Your order again: "; cin >> type; } //done } bug fixed |
@Op. please help I met this girl on whatsapp group. so I asked her "I will like to meet". and we meet two weeks later, so I told her what is on mind. but she keep saying no up till now since October. though I normally run out of what to say and some little shyness in me. please I need help. I used some of the lesson here this morning for her (Morning sweet, hope u slept and had a happy wake) and I see some sign. |
DailyNews: ...and the girls/ladies are also reading all these open tactics to be used on themmaybe someone should create whatsapp group |
please add me to m7 whatsapp group 08141161177 |
davuvid: lols..@uniport babes ![]() |
add yours ![]() |
UNIVERSITY CHICK STATISTICS - CHECK THAT OF YOUR SCHOOL HERE * 85% of FUTA chicks dont know what 'Sharwama' means. * 90% of UNILAG chicks hasaborted a minimum of 5times before their final year. * Only 20% of Nwafor Orizu College of edu. girls have actually seen an aeroplane. * 60% of IMT chicks can open their legs for you if you offer them okpa and coke. * 77% of Fed. Poly Oko chicks have never seen a BB before. (no wonder) * 96 of LASU babes wear one pant for three months * 88% of ESUT chicks have yam legs * All the chicks in Covenant university hide their phones inside their panties to avoid detention * 79% of DELSU chicks have orgasms as soon as they hear gun shots * 98% of UNN chicks have hair on their chests and Nipples * 80% of UNIPORT chicks carry their panties in their handbag cos they dont know where they will spend the night * 90% of FUTO chicks look like Weird MC * 71% of ABSU chicks wear second hand panties(I don witness this one) * 67% of UNIJOS babes howl like witches during sex * 90% of UNILAG chicks don't wear pant at all * 74% of UNIILORIN chicks guzzle sperm like cold beer * 80% of ANSU chicks don't sleep in their hostels during weekends. * No UNICAL female student is a virgin. * 70% of UNIBEN chicks live with their school boyfriends * 60% of UNAAB girls have bushy vag*na * 80% of UI girls have body odour * 90% Of UNIOSUN Girls can't boast of N4000 in their Bank Account - Broke Ass. True or False? |
my q2 solution is ready but I need to fix so bugs their. coz I keep getting run time error. |
thank you all. I will post my solution to question 2 and 3 dis nite. question 1 and 4 is solve by u |
join me to solve this seven questions this week Assignment for chapter five (while loop, for loop, do-while loop) HOD: ALEX ALLAIN STUDENT: XARMZON COURSE: JUMPING INTO C++ Q1: write a program that prints out then entire lyrics to a full rendition of "99 bottles of beer" Q2: write a menu program that let the user select from a list of options, and if the input is not one of the options, reprint the list. Q3: write a program that compute a running sum of inputs from the user, terminate when the gives an input of zero (0) Q4: write a password prompt that give a user only a certain number of password entry attempts, so that the user cannot easily write a password cracker. Q5: try writing each practise problem with each kind of loop, notice which loops work well for each kind problem. Q6: write a program that displays first 20 square numbers. Q7: write a program that provides the option tallying up the result of a poll with 3 possible values. First input to the program is the poll question; the next three input are the possible answers. The first answer is indicated by 1, the second by 2, the third by 3, the answers are tailed until a zero (0) is entered. The program should then show the results of the poll try making a bar graph that show the results properly scale to fit on your screen no matter how many results were entered. Good luck! |
1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 (of 29 pages)


