Question
For the assignment, we will write a program that calculates the total rating for some number of tweets as a percentage. The user should input
For the assignment, we will write a program that calculates the total rating for some number of tweets as a percentage. The user should input the value for the name of the person followed by the count of the tweet likes and total tweets. Calculate the overall percentage (sum of the total tweets liked divided by the total tweets possible) and output it as a percentage. Then determine the twitter rating using the following scale: Awesome: 93%-100% ; Semi-awesome: 90%-92.99% ; Better than most: 87%-89.99% ; Well liked: 83%-86.99%; Semi-well liked: 80%-82.99%; Pretty good: 77%-79.99%; Good: 73%-76.99%; Okay, I guess: 70%-72.99%; Some dislikes: 67%-69.99%; More dislikes than not: 63%-66.99%; Dislikes rule: 60%-62.99%; Oh, bad news: Less than 60%. Thats a bit of a logical construct to put together, but maybe well reuse it later! Match your program with the sample input and output as shown below: Who is the twitterer? 3
Number of tweets: 10 Number of likes: 10 Your total is 10 out of 10, or 100.00%. Your twitter rating is Awesome. Here is the psuedocode: Declare a variable called twittererName and assign it to be Declare a variable called tweets and assign it to be 0 Declare a variable called likes and assign it to be 0 Display and prompt the user for the name Display and prompt the user for the total tweets Display and prompt the user for the total likes Declare a variable called percentage and set it to the total likes divided by the total tweets and multiply it by 100 to get the whole number* Display this as illustrated in the program specifications Define a nested decision construct that asks if the percentage is greater than 93.00 display Your twitter rating is Awesome, etcetera, as illustrated in the program specifications. Because we are using integers (which are preferred), we need to avoid what is called integer division. The way to do this is by using static_cast, as seen below. We will discuss integer division in lectures quite a bit. static_cast
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