Answer:
Check the explanation
Explanation:
File: Seat.h:
typedef struct Seat
{
int seatNumber;
string customerFullName;
double seatCost;
};
File: Stadium.h
class Stadium
{
//Data Members
private:
Seat seats[1000];
string stadiumName;
int numOccupiedSeats;
public:
Stadium(string); //Constructor
void assignSeat(double, string);
void unAssignedSeat(int seatNumber);
int getNumberOfAssignedSeats();
double getCostOfSeat(double seatNumber);
}
Answer:
Move the duplicated code outside of the if statement
Answer:
Sure, what do you need help with
Explanation:
I don’t know if this supports all, but try lenntech, duckters, and I will add on later
Answer:
Code is given below and output is attached as an image.
Explanation:
#include <iostream>
#include <fstream>
using namespace std;
bool isPalindrome(int n)
{
// Find reverse of n
int rev = 0;
for (int i = n; i > 0; i /= 10)
rev = rev * 10 + i % 10;
// If n and rev are same,then n is a palindrome
return (n == rev);
}
int main()
{
int min = 1; // Lower Bound
int max = 200; // Upper Bound
ofstream myfile;
myfile.open("palindrome.txt");
for (int i = min + 1; i < max; i++)
if (isPalindrome(i))
myfile << i << endl;
myfile.close();
return 0;
}