-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA15.ts
28 lines (12 loc) · 984 Bytes
/
A15.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* You just heard that one of your guests can’t make the dinner, so you need to send out a new set of invitations. You’ll have to think of someone else to invite.
• Start with your program from Exercise 14. Add a print statement at the end of your program stating the name of the guest who can’t make it.
• Modify your list, replacing the name of the guest who can’t make it with the name of the new person you are inviting.
• Print a second set of invitation messages, one for each person who is still in your list. */
let guest: string []= ["Aru", "Sob", "Komi", "Fazi"];
let changeGuest: string = "Fazi";
console.log(`Dear! ${changeGuest}! Sorry But Can't Make It For Dinner.\n`);
let addguest: string = "Nighat";
guest[guest.indexOf(changeGuest)] =addguest;
console.log("New Guest List", guest, '\n');
console.log("Invitation Sent List: \n")
guest.map((items) => console.log(`Dear! ${items} You Are Invited For Dinner`));