1. Using switch statement, write a C program to do the following problems: [0.5 mark] A)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Using switch statement, write a C program to do the following problems: [0.5 mark] A) If the user enters 1, the program prints the following structure using while loop: 1 22 333 4444 55555 B) If the user enters 2, the program prints the following structure using while loop: 12345 1234 123 12 1 B) If the user enters 2, the program prints the following structure using while loop: 1234 5 1234 123 12 2. Write a function that takes two integer inputs and returns the sum of all even numbers between these inputs, and another function that takes two integer inputs and returns the sum of odd numbers between these inputs .In main function, the program will asks the user to enter two integer numbers and then passes them to these two functions and display the result of each of them. [0.5 mark] A. Write a C program to process a collection of the speeds of vehicles. Your program should count and print the number of vehicles moving at a high speed (90 miles/hour or higher), the number of vehicles moving at a medium speed (50-90 miles/hour), and the number of vehicles moving at a slow speed (less than 50 miles/hour). It should also display the category of each vehicle. Test your program on the following data: Speed of vehicles (in miles): 43 23 54 57 68 67 51 90 33 22 11 88 34 52 75 12 78 32 89 14 65 67 97 53 10 47 34 B. Modify your program to display the average speed of a vehicle (a real number) at the end of the run. [0.75 mark] 4. Write a C program that asks the user to enter 15 integer numbers and then store them in the array. Then, the program will find the second largest clement in array and its index without sorting the array. For example, In this array (-55,-2,1, 2, -3, 0, 5, 9, 13, 1, 4, 3, 2, 1, 0}, the second largest element is 9 [found at index 7]. [0.75 mark] 1. Using switch statement, write a C program to do the following problems: [0.5 mark] A) If the user enters 1, the program prints the following structure using while loop: 1 22 333 4444 55555 B) If the user enters 2, the program prints the following structure using while loop: 12345 1234 123 12 1 B) If the user enters 2, the program prints the following structure using while loop: 1234 5 1234 123 12 2. Write a function that takes two integer inputs and returns the sum of all even numbers between these inputs, and another function that takes two integer inputs and returns the sum of odd numbers between these inputs .In main function, the program will asks the user to enter two integer numbers and then passes them to these two functions and display the result of each of them. [0.5 mark] A. Write a C program to process a collection of the speeds of vehicles. Your program should count and print the number of vehicles moving at a high speed (90 miles/hour or higher), the number of vehicles moving at a medium speed (50-90 miles/hour), and the number of vehicles moving at a slow speed (less than 50 miles/hour). It should also display the category of each vehicle. Test your program on the following data: Speed of vehicles (in miles): 43 23 54 57 68 67 51 90 33 22 11 88 34 52 75 12 78 32 89 14 65 67 97 53 10 47 34 B. Modify your program to display the average speed of a vehicle (a real number) at the end of the run. [0.75 mark] 4. Write a C program that asks the user to enter 15 integer numbers and then store them in the array. Then, the program will find the second largest clement in array and its index without sorting the array. For example, In this array (-55,-2,1, 2, -3, 0, 5, 9, 13, 1, 4, 3, 2, 1, 0}, the second largest element is 9 [found at index 7]. [0.75 mark]
Expert Answer:
Related Book For
Posted Date:
Students also viewed these finance questions
-
Determine CPI, ETC (1), and EAC. Activity Total PV 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 6 6 2 20 10 10 3 30 9 6 6 6 3 4 20 8 2 5 5 5 16 4 4 4 4 6 18 9 9 7 8 4 4 Status Report: Ending Period 5 Task %...
-
Allergan is a major pharmaceutical firm. You work for Allergan's CFO and are evaluating a major and expensive drug trial. The drug trial would require an investment of $95 million today If the trial...
-
(1) Given A and i. (1a) Find the equivalent amount at the end of year 1. (1b) Find the equilvalent amount at the end of year B. (2) Given X and i, Find the annual equivalent A from year S to 8. *...
-
Table P-23 contains Southwest Airlines' quarterly income before extraordinary items ($MM) for the years 1988-1999. a. Plot the income data as a time series and describe any patterns that exist. b. Is...
-
A company currently maintains inventory at eight stocking locations. The total safety stock inventory carried at these eight locations is 50,000 units. If the company decides to combine the eight...
-
Return to the Sleekfon and Sturdyfon data in Exercise 4. Management has estimated that demand in global markets is likely to grow. North America, Japan, and Europe (EU) are relatively saturated and...
-
La Salle Exploration Company reported these figures for 2008 and 2007: Compute rate of return on total assets and rate of return on common stockholders' equity for 2008. Do these rates of return...
-
An investor is thinking about buying some shares of Razortronics, Inc., at $75 a share. She expects the price of the stock to raise to $115 a share over the next three years. During that time, she...
-
19. An article was sold for $212.00. The amount paid included a sales tax of 6%. Find the amount of sales tax on the article.
-
Include a reflection to the client that discusses the tax recommendations and consequences of your newly chosen energy-friendly initiative. Specifically, you must address the following: Identify the...
-
The measure of activity that allows for routine variations in manufacturing activity is: A.theoretical capacity B. practical capacity C. normal capacity D. expected capacity
-
Wada Kealotswe is the founder and director of Aiko Creations t/a Eco Zera in Botswana, a company that manufactures eco graphite and colour pencils. The business has been running for 2 years and today...
-
Enterprise Risk Management has been conceptualized in two dimensions, i.e. the types of risk and the various risk management process steps. Shoprite, one of the largest retailers in South Africa has...
-
On November 1 st of the current year Elwha Corporation took out a $ 5 0 , 0 0 0 , 3 year loan with an interest rate of 7 % . Elwha Corporation will pay all the interest and principal at the end of...
-
The following information is provided for the book value of stockholder's equity of Walker Inc. as of December 31, 2021 (figures in millions). Common shares $216 Retained earnings $4,865 Accumulated...
-
Orange is a b2b cellular phone service company that serves carrier, retail, and enterprise customers that offer cellular network services or equipment to retail customers. Orange operates in 60...
-
During April, Burke Company has budgeted cash collections from customers of $68,000 and cash disbursements of $86,500. The budgeted ending Cash balances for March and April are $10,000 and $12,000,...
-
Create a data model for one of the processes in the end-of-chapter Exercises for Chapter 4. Explain how you would balance the data model and process model.
-
What is the accounting equation for the balance sheet?
-
What is the role of trusts in estate planning?
-
Hy Potenuse bought a $10,000 Treasury bill at 0.115 percent discount for 13 weeks (91 days). a. How much does Hy pay for the bill? b. What is the effective rate of interest?
-
What basic set of factors must a firm consider when selecting a location for a production facility?
-
What basic factors must be addressed when managing international service operations?
-
Why is it important for organizations to control productivity?
Study smarter with the SolutionInn App