-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram_34.ts
29 lines (22 loc) · 1.07 KB
/
program_34.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
29
/*
* Pizzas: Think of at least three kinds of your favorite pizza. Store these pizza names in a array,
* and then use a for loop to print the name of each pizza.
• Modify your for loop to print a sentence using the name of the pizza
* instead of printing just the name of the pizza.
* For each pizza you should have one line of output containing
* a simple statement like I like pepperoni pizza.
• Add a line at the end of your program, outside the for loop, that states how much you like pizza.
* The output should consist of three or more lines about the kinds of
* pizza you like and then an additional sentence, such as I really love pizza!
*/
const pizza: string[] = ["Cheese Lover", "Spicy", "Fagita"];
for (const names of pizza) {
console.log(`I just love ${names} flavour pizza`);
}
// Add a line at the end of your program, outside the for loop, that states how much you like pizza
console.log('I really love pizza!');
console.log('My favorite kinds of pizza are:');
for (const names of pizza) {
console.log(`- ${names}`);
}
console.log('I really love pizza!');