using System;
public class Program
{
/********************************
Summary: An application that simulates a robot factory.
Description:
Each robot require a different number of parts to be built up and has a introduction feature that will introduce themselves when invoked.
This factory will manufacture two models of robots:
- Bumblebee
- Total parts required: 1000
- Introduction feature: "Hey I am Bumblebee and ready to rumble."
- Baymax
- Total parts required: 100
- Introduction feature: "Hello, I am Baymax, your personal healthcare companion."
To ensure that the manufactured robots are functioning, the introduction feature can be invoked on each robot.
During the manufacturing process, a random number of defective parts might be installed, the defective rate of the robot is calculated by the following formula:
- Defective parts in the robot/Total parts of the robot
Note: Defective parts will never be more than half of total parts in the robot
Robots that have been manufactured will then go through a quality control process and robots which exceeds the acceptable defective rate will be discarded.
*/
Your tasks:
1. Create the necessary classes, abstract classes or interfaces or any other constructs to represent the robots.
2. Create 50 robots of each type and invoke each of their introduction feature.
3. Create a service that checks the manufacturing quality based on the acceptable defective rate of 15%. The sample quality control output is here:
Created {XX number} robots (X number each for Bumblebee and Baymax)
{Y number} are functional.
{Z number} were defective.
public static void Main()
Console.WriteLine("Hello World Robots Factory");
}
public class Robot
// Identifier for the robot
private Guid Id;
// Number of defective parts that this robot has
private int DefectiveParts;
// Total number of parts in this robot
private int TotalParts;
public Robot()
// Construct the robot, a random number of defective parts will be inserted during the process
// Defective parts will never be more than half of total parts in the robot
// Ratio of defective parts to total parts in the robot
// Formula: defective parts divided by totalparts
public void GetDefectiveRate() => throw new NotImplementedException();
// Performs unique action tied to the robot
public void Introduce() => throw new NotImplementedException();