CMPS-4350 Advanced Software Engineering
Lab-12

Agenda:

In this lab, we will learn:

Step 1:
Go to 4350/c directory and create a cpp file. Name it lab12.cpp

Once you are done, please send me your lab or have it in your home 
directory @odin:~$/lab12.cpp so I could look at it in order to grade it.

Now, open your lab12.cpp and start coding.
Happy coding...

Step 2:
Your job is to write a snigleton class using either Meyers or classical
approach.

1) Create a class called GameSettings.
2) Define five private values which are static instance of the object, volume, brightness,
   height, and width.
3) Define a private constructor; assign a default value for each defined item.
----- Moving to public section -----
4) Write 4 setter functions for each of the defined variables.
5) Write 4 getter functions to return each of the defined variables.
6) Write a displaySetting function that print all the defined variable along
with their values.
7) Write a static GameSettings getInstance function to return the instance defined privately.
  • If value of instance is NULL create new GameSettings and assign it to instance.
  • return instance

  • Step 3:
    Before moving to main, define the instance in ordre to have globally defined.
    
    In main, define a pointer of type GameSettings that is going to be your
    variable. 
    Also, define two int to hold hours and minutes.
    
    Prompt the user to input the time of the day in the range of 00:00 to 23:59.
    Call setTime(userInput) to check if the time is between 17:00 to
    05:00(night-time)
    	adjust the brightness to be lower than day time
    else (day-time)
    	adjust the brightness to be higher than night-time
    
    Output the time a user did input along with the new values.
    
    If you have time, you can work on extra tasks:
    
  • Prompt the user to input the vloume level they want and set the new value.
  • Print the new values.
  • Do the same for width and height as well.
  • Don't forget to email me your program or to email me the link of the
    directory that have your work on.
    Email it to aaldeshash@cs.csub.edu
    Thank you for your time.