Question

In: Computer Science

Instructions (in C++): 1 ) Use a void function to print the following message (should be...

Instructions (in C++):
1 ) Use a void function to print the following message (should be in welcome function)
Welcome to the Event Scheduling program
2 ) create 3 int arrays with 3 positions (one array for days one array for moths and one array for years) (should be in main)
3 ) Create a file that contains the following (you can just create the file or write the file in the program)
1 / 26 / 2021
12 / 13 / 2020
2 / 1 / 2021
4 ) Read the file and place the day, month and year for each date into the appropriate array (should be in main)
5 ) ask the user to type a date in the following format (should be in main)
<day> / <month> / <year>
6 ) Determine whether the date the user entered is the same as any of the dates in your arrays (should be in dateCompare function)
7a) If the date does not match any of the dates in the arrays then print the following message:
<day> / <month> / <year> is available. We will add you to our calendar (should be in printMessage function)
7b) If the date does match any of the dates in the array then print the following message:
<day> / <month> / <year> is not available. Please try again with a different date (should be in printMessage function)
8 ) Ask the user if they want to enter more dates(should be in main)
9a ) if the user answers “yes” then repeat steps 5-8 (should be in main)
9b ) if the user answer “no” then print the following message: Thanks for using the Event Scheduling program(should be in main)
9c ) if the user types anything else then print the following message:
Did not follow instructions(should be in main)

Solutions

Expert Solution

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

Class Program()

{

Public:

int date[200], a= 0,x,date_read[30];

char answer;

void message()

{

std::cout << "Welcome to the Event Scheduling program";

}

void date_display(int date[10], int& mon , int& year[10])
 {
   for(i=0;i<10;i++)
    {    
    year[i] = date[i] / 10000;
    date[i] %= 10000;
     month [i]= date[i] / 100;
   }
 for(i=0;i<10;i++)
 {    
    cout << endl << "Year: " << year[i]
             << endl << "Day : " << day[i]
             << endl << "Month:" << mon[i];
  }
}
void file_write ()
  {
   fstream file_op;
   file_op ("file_date", ios::out | ios::in );
   fstream file;
   date = 22102020
   cout << "Write date in file." << endl;
   cin.getline(date, sizeof(date));
   // Writing on file
   File_op << date << endl;
  }
void file_read()
{   
   // check that array is not already full
   while (a < date_read[30] && is >> x)
   // read integer from file
   Date_read[a++] = x;
   // print the integers stored in the array
   cout<<"The dates are:"<<"\n";
   for (int i = 0; i < a; i++) {
      cout << read_date[i] <<' ';
   }
   //close the file
   is.close();
}
int main()
 {
    // create object of program class
    Program prog;
    while(true)
    {
        cout<<"Do you want to continue?(Y/N)"<<endl;
        cin >> answer;
        if(answer == 'Y'|| answer =='y'){
        return true;
        }
else if(choice =='N'||choice =='n')
{
        return false;
        }
else
{
Print(“Enter right choice”)
 }
return 0;
}
 
 
 

Related Solutions

In C++ Instructions: Use a void function to print the following message (should be in welcome...
In C++ Instructions: Use a void function to print the following message (should be in welcome function) Welcome to the Event Scheduling program create 3 int arrays with 3 positions (one array for days one array for moths and one array for years) (should be in main) Create a file that contains the following (you can just create the file or write the file in the program) 1 / 26 / 2021 12 / 13 / 2020 2 / 1...
Write in C++ Print the following heading (should be in heading function) Welcome to Reference parameters...
Write in C++ Print the following heading (should be in heading function) Welcome to Reference parameters 2 ) ask the user for 2 numbers (should be in main) 3 ) Calculate the sum and product of the numbers using reference parameters (should be in getAnswer function) 4 ) Print the sum and product of the numbers in the following format: (should be in printmessage function) Here is the function you need        Function name | Parameters                       | Return Type    heading |...
(True or False) The following function will compile. void print(int num) { return num+1; } Group...
(True or False) The following function will compile. void print(int num) { return num+1; } Group of answer choices True False Flag this Question Question 2 10 pts (True or False) The following code will output "I was true". bool isGreater(string s1, string s2) { if(s1 > s2) { return true; } return false; } int main() { if(isGreater("before","back")) { cout << "I was true"; } else { cout << "I was false"; } return 0; } Group of answer...
Even Odd Average (C++ LANGUAGE) Write the following functions: Function #1 Write the function Print. The...
Even Odd Average (C++ LANGUAGE) Write the following functions: Function #1 Write the function Print. The function will have one int 1D array n and one int size as parameters. The function will display all the values of n on one line. Function #2 Write the function AverageEvenOdd. The function will have one int 1D array n and one int size as parameters. The size of the array is given by the parameter int size. Therefore, the function should work...
Make a function definition in C for the following: void insert (double *b, int c, double...
Make a function definition in C for the following: void insert (double *b, int c, double s, int pos); //Insert value s at position pos in array. //needs: // c > 0, pos >= 0, and pos <= c-1. Elements b[0]...b[c-1] exist. //this will do: //Elements from indexes pos up to c-2 have been moved up to indexes pos+1 up to c-1. The value s has been copied into b[pos]. //Note: the data that was in b[c-1] when the function...
3. [Method 1] In the Main class, write a static void method to print the following...
3. [Method 1] In the Main class, write a static void method to print the following text by making use of a loop. Solutions without a loop will receive no credit. 1: All work and no play makes Jack a dull boy. 2: All work and no play makes Jack a dull boy. 3: All work and no play makes Jack a dull boy. 4: All work and no play makes Jack a dull boy. 4. [Method 2] In the...
C++ Write the C++ code for a void function that prompts the user to enter a...
C++ Write the C++ code for a void function that prompts the user to enter a name, and then stores the user's response in the string variable whose address is passed to the function. Name the function getName.
In c++ Rewrite the following recursive method into an iterative function.  void mystery (int n) {  ...
In c++ Rewrite the following recursive method into an iterative function.  void mystery (int n) {    cout<<"? ";    if (n > 0)      mystery (n - 1); }
MUST BE DONE IN C (NOT C++) Using an array and a function, print the values...
MUST BE DONE IN C (NOT C++) Using an array and a function, print the values of an array backwards. Please follow these guidelines: - Setup your array manually (whichever values you want, as many as you want and whichever datatype you prefer). - Call your function. You should send two parameters to such function: the array’s length and the array. - Inside the function, go ahead and print the array backwards. - Your function shouldn’t return anything
Use your webcam and record a movie, write a motion detection code and print the message...
Use your webcam and record a movie, write a motion detection code and print the message "Motion Detected" on the original frame. Try to make a better visualization by using different masking. ---using Numpy and opencv
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT