₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,292 members, 8,421,208 topics. Date: Saturday, 06 June 2026 at 12:05 AM

Toggle theme

Prudentexpress's Posts

Nairaland ForumPrudentexpress's ProfilePrudentexpress's Posts

1 (of 1 pages)

BusinessNigeria Leads by prudentexpress(op): 7:13pm On May 20, 2018
Does anyone knows where I can buy Nigerian leads from ?
Technology MarketNigerian Full Leads by prudentexpress(op): 2:23pm On May 20, 2018
Does anybody means who has Nigerian full leads ? Please drop your contact information if you do.
ProgrammingRe: C++ Drop Your Code. by prudentexpress(op): 11:21pm On Feb 22, 2015
This program generates a random number and ask user to guess what the number is between 1 -10. You can easily modify it to any number you
desire.

=================================================================================

#include <iostream>
using namespace std;
#include <stdlib.h>
#include <ctime>




int main()
{
int randomNumber; // holds random number
int guess; // holds guess
int counter = 0; // holds number of guesses

cout << " \t \t Welcome To Random Number Guessing Game" << endl; // Display title
cout << " \t \t \t Guess between 1 - 10 " << endl; /// Display title
cout << endl << endl; // create double newline

while (true)
{
counter++; // count the number of guesses
srand(time(0)); // seed with time
randomNumber = 1 + (rand() % 10); // generate random numbers between 1 to 10 for easy guess



cout << "Guess what the number is ? "; //Prompt user for input
cin >> guess; // get input

if (guess == randomNumber) // check to see if they are equal
{
cout << "You are right !!! The random number was " << randomNumber << endl;
break;

}
else if (guess > randomNumber) // check to see guess is greater than randomNumber
{
cout << "Too high, try again. The random number was " << randomNumber << endl;
}
else // Check to see if guess is less than randomNumber
{
cout << "Too low, try again. The random number was " << randomNumber << endl;
}

cout << endl; // create a newline

//counter++;
}

cout << "You guessed right in " << counter << " guesses. keep up the great job !!!" << endl;
cout << endl << endl; // create double newline
return 0;
}
ProgrammingRe: C++ Drop Your Code. by prudentexpress(op): 11:04pm On Feb 22, 2015
This program calculates the occupancy rate for a hotel. The program asks user for how many floors the hotel has.
The loop iterate once for each floor, and ask how many rooms on the each floor. It also ask how many rooms occupied on each floor.
After iteration, the program display how total rooms the hotel has, and how many are occupied. Also, it display percentage of rooms between occupied and unoccupied rooms.


======================================================================================

#include <iostream>
using namespace std;
#include <iomanip>




int main()
{
int numberOfFloor; // holds number of floors
int numberOfRoom = 0; // holds number of rooms
int numberOfRoomOcuppied = 0; //holds room occupied
int totalRoom = 0; // holds total room
int totalUnocuppied = 0; // holds total room not occuppied
int Unocuppiedroom = 0; //holds the difference between totalroom and unoccuppied room

cout << "Enter floor: "; //Prompt user to input of number of floor
cin >> numberOfFloor; // gets the input

while (numberOfFloor <= 0) //validates the input
{
cout << "Number of floor should be greater than " << numberOfFloor << endl;
cout << "Enter floor: ";
cin >> numberOfFloor;

}

cout << endl << endl; // create double newline.
for (int floor = 1; floor <= numberOfFloor; floor++) // loops through the number of floor inputed by user
{
if (floor == 13) // skips floor step as required by the client
{
continue;
}
cout << "Floor " << floor << " rooms are ?: "; // ask for number of rooms on the a particular floor
cin >> numberOfRoom; // gets the input

while (numberOfRoom < 10) // validates the input to make sure it's more than 10 rooms
{
cout << "Number of room must be more than 10 " << endl;
cout << "Floor " << floor << " rooms are ?: ";
cin >> numberOfRoom;
}
cout << "Floor " << floor << " occupied rooms are ?: "; //ask for number of rooms occuppeid on a particular floor
cin >> numberOfRoomOcuppied; // gets the input
cout << "--------------------------------" << endl; // create a line just for readability
cout << endl; // create a newline

totalRoom += numberOfRoom; // adds number of rooms together
totalUnocuppied += numberOfRoomOcuppied; //adds number of unoccuppied rooms together
}

Unocuppiedroom = totalRoom - totalUnocuppied;

cout << "Hotel total rooms are " << totalRoom << endl; //displays total rooms
cout << "Hotel occuppied rooms are " << totalUnocuppied << endl; // displays occuppied rooms
cout << "Hotel unoccupied rooms are " << Unocuppiedroom << endl; // displays unoccuppied rooms
cout << fixed << setprecision(2) << "Hotel average is " << (double)totalUnocuppied / totalRoom * 100 << "%" << endl << endl;//calculate the average percentage




return 0;
}
ProgrammingRe: C++ Drop Your Code. by prudentexpress(op): 10:48pm On Feb 22, 2015
This program changes the order a number is inputted into reverse order. For example, 1234 will be 4321


======================================================================================

#include <iostream>
using namespace std;

int main()
{
int input; // holds the input
const int BASE = 10; // hold the base
int remainder; // holds the remainder
int reverseNumber = 0; //holds the reverse number


cout << "Please enter an integer to be reversed: "; //Prompt user for input
cin >> input; // get input from user
cout << endl; // Create newline for readability

while (input)
{
remainder = input % BASE; // Get the last digit from the number
reverseNumber = (reverseNumber*BASE) + remainder; // Change the reverse number digit by digit
input /= BASE; // take off the last digit from number and ready for the next.

}
cout << "The reverse order is " << reverseNumber << endl << endl; // Display the reversed order.



return 0;
}
ProgrammingRe: C++ Drop Your Code. by prudentexpress(op): 10:44pm On Feb 22, 2015
This program sums up all the digits inputted on the same line. for example, if user input 1234, the answer will be 10.



=================================================================================

#include <iostream>
using namespace std;


int main()
{
int input; // holds input
int sum = 0; // Will hold the sum of digits to be added together

cout << "Please enter the digits you want to sum: "; // Prompt user for input
cin >> input; // get input from user

cout << endl; // create a newline for readability
while (input) // checks if the condition is not false
{
sum += input % 10; // get the last digit of the number and add it to the variable sum
input /= 10; // get rid of the last number added to sum.

}
cout << "The sum of the digits are: " << sum << endl << endl; // display the answer.


}
ProgrammingRe: C++ Drop Your Code. by prudentexpress(op): 10:32pm On Feb 22, 2015
This program convert base ten number into any base between base 2 and base 9.


===================================================================================

#include <iostream>
using namespace std;
#include <string>


int main()
{
int baseTen = 0; // holds the value of base 10
int anyBase = 0; // holds the value of a base the value will be converted to.
string display; // display the output
cout << "Please enter number in \"base 10 \": "; //Prompt user for input for base 10
cin >> baseTen; // get base 10 input from user

while (baseTen <0) // validate the input of base 10
{
cout << "Please enter number in \"base 10 \" and has to be greater than 0"": ";
cin >> baseTen;
}
cout << endl; // create newline for readability

cout << "Please enter the converted based between \"base 2 - 9 \": "; // prompt user for input for the converted base
cin >> anyBase; //get converted base from user

while (anyBase <2 || anyBase >9) // validate the input for converted base
{
cout << "Please enter the converted based between \"base 2 - 9 \": ";
cin >> anyBase;
}
cout << endl; // create newline for readability

if (baseTen == 0) // Check if baseTen is 0
{
cout << "The output of " << baseTen << " in base " << anyBase << " is 0" << endl << endl; exit(1); // Display the output if baseTen is 0
}
while (baseTen)
{
display = (char)(baseTen % anyBase + '0') + display; // Convert from based 10 to desired based
baseTen /= anyBase;
}
cout << "The output in base " << anyBase << " is : " << display << endl << endl; // display the result

}
ProgrammingC++ Drop Your Code. by prudentexpress(op): 10:25pm On Feb 22, 2015
I decided to create this post because I was looking around on Nairaland if there is a post where anyone can just drop their code, so to exchange intelligence. I will drop couple of codes here and feel free to drop yours.
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 12:38am On Aug 15, 2014
Sold! Sold!! Sold!!!
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 8:53pm On Aug 03, 2014
Come buy me
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 9:35pm On Jul 31, 2014
elijah101: where is the car located
It's located on the Island.
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 9:49pm On Jul 30, 2014
I'm here.
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 2:03pm On Jul 29, 2014
Buy
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 4:52am On Jul 26, 2014
Buy me!!!
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 5:55am On Jul 23, 2014
Buy me
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 12:25am On Jul 21, 2014
labamba: Hello Sir,

how much will the LExus go for last ?
Can i offer 1m ?
await your feedback.
thanks
I will take 1 million for it if you are a serious buyer. Call 07033444600
AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 11:25pm On Jul 20, 2014
Pictures

AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 11:24pm On Jul 20, 2014
Picss

AutosRe: Used 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op): 11:23pm On Jul 20, 2014
More

AutosUsed 1999 Lexus ES 300 (1.2 Million) Sold! Sold!! Sold!!! by prudentexpress(op):
4-Wheel Disc Brakes
A/C
ABS
AM/FM Stereo
Adjustable Steering Wheel
Aluminum Wheels
Automatic Headlights
Bucket Seats
Cassette
Child Safety Locks
Climate Control
Conventional Spare Tire

Cruise Control
Daytime Running Lights
Driver Air Bag
Driver Illuminated Vanity Mirror
Driver Vanity Mirror
Engine Immobilizer
Floor Mats
Fog Lamps
Front Reading Lamps
Front Side Air Bag
Front Wheel Drive
HEATED FRONT SEATS

Heated Mirrors
Intermittent Wipers
Keyless Entry
LEXUS VALUE PKG -inc: leather trim pkg in-dash 6-CD autochanger pwr moonroof
PWR TILT/SLIDE MOONROOF W/SUNSHADE
Passenger Air Bag
Passenger Illuminated Visor Mirror
Passenger Vanity Mirror
Power Door Locks
Power Driver Seat
Power Mirror(s)

Power Outlet
Power Passenger Seat
Power Steering
Power Windows
Rear Defrost
Remote Trunk Release
Tires - Front Performance
Tires - Rear Performance
Traction Control
Variable Speed Intermittent Wipers
Woodgrain Interior Trim

AdvertsH by prudentexpress(op):
Ghjkk
BusinessH by prudentexpress(op):
Hhh

1 (of 1 pages)