Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Complete the missing c# code in the bellow program required to obtain the following expected result: Welcome to c# workshops & training Registration cost varies
Complete the missing c# code in the bellow program required to obtain the following expected result:
Welcome to c# workshops & training
Registration cost varies according to the number of days as follows:
The cost for 5 days is $200
The cost for 10 days is $500
The cost for 15 days is $1000
Note: You have to comply with the instructions given as comments in the program
using System;
class Program {
public class workshop {
int nbOfdays;
decimal fees;
public workshop(int ndays, decimal fe) { nbOfdays = ndays; fees = fe; }
public override string ToString() {
// use interpolated string
____________________________________________________________
}
public static void Main(String[] args) {
String str1 = "Welcome to", str2 = "c# workshop & training", str3 = "Registration cost";
workshop[] workshops = { new workshop(5, 200), new workshop(10, 500), new workshop(15,1000) };
// printing using formatting string and the defined string variables
__________________________________________________________________
// printing using interpolated string and the defined string variables
_____________________________________________________________
// printing all workshops using foreach
_______________________________________________________________
Console.ReadKey();
}
}
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