6. Write a program that displays the number of users on a social media application based...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
6. Write a program that displays the number of users on a social media application based on the following rules: • If there is no one, return "no one online". • If there is 1 person, return "user1 online". • If there are 2 people, return "user1 and user2 online". • If there are n>2 people, return the first two names and add "and n-2 more online". Initialize an array of size N with some username(s) (maybe none) and consider the above conditions. For example, if there are 5 users, the program displays: "user1, user2 and 3 more online" 6. Write a program that displays the number of users on a social media application based on the following rules: • If there is no one, return "no one online". • If there is 1 person, return "user1 online". • If there are 2 people, return "user1 and user2 online". • If there are n>2 people, return the first two names and add "and n-2 more online". Initialize an array of size N with some username(s) (maybe none) and consider the above conditions. For example, if there are 5 users, the program displays: "user1, user2 and 3 more online" 6. Write a program that displays the number of users on a social media application based on the following rules: • If there is no one, return "no one online". • If there is 1 person, return "user1 online". • If there are 2 people, return "user1 and user2 online". • If there are n>2 people, return the first two names and add "and n-2 more online". Initialize an array of size N with some username(s) (maybe none) and consider the above conditions. For example, if there are 5 users, the program displays: "user1, user2 and 3 more online" 6. Write a program that displays the number of users on a social media application based on the following rules: • If there is no one, return "no one online". • If there is 1 person, return "user1 online". • If there are 2 people, return "user1 and user2 online". • If there are n>2 people, return the first two names and add "and n-2 more online". Initialize an array of size N with some username(s) (maybe none) and consider the above conditions. For example, if there are 5 users, the program displays: "user1, user2 and 3 more online"
Expert Answer:
Answer rating: 100% (QA)
Answer Certainly Below is a simple Python program that impl... View the full answer
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Posted Date:
Students also viewed these programming questions
-
A bakery wants to determine how many trays of doughnuts it should prepare each day. Demand is normal with a mean of 5 trays and standard deviation of 2 trays. If the owner wants a service level of at...
-
The Moondance Riding Academy held its annual horse show for 3 days. The total amount collected in entry fees for the 3 days was $1,450. The amount collected, in dollars, is shown for each of the 3...
-
Question 7 0/1 pt 399 Details The average fruit fly will lay 395 eggs into rotting fruit. A biologist wants to see if the average will change for flies that have a certain gene modified. The data...
-
State Einstein's postulates of the special theory of relativity. ii. Write down Einstein's mass-energy equivalence formula. iii. In the case of two inertial frames of reference, S' moving at a...
-
Enter the following transactions in the books of 'Mary Ward' for December (use T accounts). 1 Dec Introduced a motor vehicle to the new business worth 8,000 1 Dec Transferred a computer from home to...
-
Both managerial accounting and financial accounting provide useful information to decision makers. Indicate in the following chart the most likely source of information for each business decision (a...
-
Dale Corporation has the following data: Dale's return on assets is a. \(15 \%\) b. \(12 \%\) c. \(10 \%\) d. \(4 \%\) Net income $22,000 Average total assets $300,000 Interest expense 8,000 Average...
-
Xellnet provides e- commerce software for the pharmaceuticals industry. Xellnet is orga-nized into several divisions. A companywide planning committee sets general strategy and goals for the company...
-
Sales Mix and Break-Even Sales Data related to the expected sales of laptops and tablets for Tech Products Inc. for the current year, which is typical of recent years, are as follows: Products...
-
Determine whether f (t) is at least piecewise continuous in the interval [0, 10]. t, 0
-
How does sport differ from other forms of entertainment?
-
Provide five recent examples of sports marketing that have been in the news and describe how each relates to our definition of sports marketing.
-
Choose any professional sports team and describe how it puts the basic sports marketing functions into practice.
-
Explain the relevance of managers using shaping behavior.
-
What do the two liquidity ratios, current and acid, measure and reveal?
-
2) What is the coefficient for oxygen when the following equation is balanced? KMnO,-K0+ MnO +50 8)2 D) 3 12) When the equation NR-2Nbalanced the coefficient of hydrogen is 91 D) 4 13) What ions...
-
Consider model (9.18). What is the effect on the model parameter estimates, their standard errors, and the goodness-of-fit statistics when (a) The times at risk are doubled, but the numbers of deaths...
-
What is the subscript of the first character contained in a string variable? a. 0 (zero) b. 1 (one)
-
In this exercise, you modify the Rectangle class from Lab 15-2 so that it allows a program to view the contents of the length and width data members. You also modify the Terney Landscaping program so...
-
Which of the following statements creates a two-dimensional array that contains three rows and four columns? a. int rates[3, 4] = {0}; b. int rates[4, 3] = {0}; c. int rates[3][4] = {0}; d. int...
-
Name eight documents or records that would be examined in the review of subsequent events. For what period would the review be conducted?
-
List eleven matters that would be discussed with management in connection with the audit of subsequent events.
-
What are the purposes of management representations?
Study smarter with the SolutionInn App