Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Math.random function to generate a number between 20 and 100 and then use the ngSwitch directive to display a letter grade based on this
- Use Math.random function to generate a number between 20 and 100 and then use the ngSwitch directive to display a letter grade based on this class grading policy.
- add implements OnInit to the AppComponent class
- add variable x in the AppComponent class
- add ngOnInit(){ this.x = Math.floor(Math.random()*10);}
- add {{x}} in the app.components.html file
- You should see numbers from 1-9 when you refresh the page
- Change formula in #c to generate numbers from 20 to 100.
- Change {{x}} in #d to ngSwitch directive
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