Question
create an application which contains the following: A class called Generator, which randomly generates an integer value in the range 1 to 10000 whenever the
create an application which contains the following:
A class called Generator, which randomly generates an integer value in the range 1 to 10000 whenever the user requests a new value. This newly generated value must be automatically passed to two different types of objects (classes): o Sum: It should receive the randomly generated value, add it to the previously generated value (if no previous value exists use 0) and then display the result to the console window. o Date: It should receive the randomly generated value, add it to the current date as a number of days and display the generated date to the console window.
The program should continuously loop until the user presses the e-key to end the program. At each iteration of the loop the screen should be cleared, a new random value generated, and the Sum and Date values displayed on the console window. The program should be based on the observer pattern, which means it should include all of the interfaces and methods required to align to this pattern.
language is C#
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started