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...
-
On January 1, 2015, P Company purchased equipment from its 80% owned subsidiary for $600,000. The carrying value of the equipment on the books of S Company was $450,000. The equipment had a remaining...
-
Find the indicated derivative. du dt if v = t 1 t
-
How has the ownership of UK shares changed over the past 50 years?
-
A manager of Fairways and Greens Sporting Goods Company is considering accepting an order from an overseas customer. This customer has requested an order for 20,000 dozen golf balls at a price of $24...
-
On January 1, 2024, the Mason Manufacturing Company began construction of a building to be used as its office headquarters. The building was completed on September 30, 2025. Expenditures on the...
-
What are the factors you need to consider in understanding the business? Explain.
-
Accounting Question: Currency Exchange and Foreign Transactions Determine the monetary impact on financial statements of a U . K . company with sales in Poland, where the local currency depreciated...
-
Assume that the New York indirect quotation for the Canadian dollar is 1.1860 and the New York direct quote for the Australian dollar is 0.6024. The value of the Australian dollar in terms of...
-
How can I identify these? Flexible budget parameters How budgets assist managers Major objectives of budget process Treatment of fixed cost in a flexible budget Unfavorable production-volume variance
-
1 . The following information is provided for Wolf Company: Retained earnings $ 4 4 5 , 0 0 Preferred stock , 5 % , $ 5 0 about 1 0 0 , 0 0 0 Organization expense 2 , 5 0 0 Additional paid - in...
-
The total payroll of Waters Company for the month of October 2 0 0 7 was $ 3 6 0 , 0 0 0 . Taxable wages for Social Security ( 6 . 2 % ) were $ 2 7 0 , 0 0 0 Taxable wages for SUTA ( 1 % ) were $ 6 0...
-
What metabolic pathways are intricately involved in the biosynthesis of PHA (Polyhydroxyalkanoate)?
-
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...
-
Why do auditors prepare analytic flowcharts of processing systems?
-
A logical data flow diagram can be used to document what aspect of a system?
-
Relate the concept of work measurement to the system implementation process.
Study smarter with the SolutionInn App