0 Up votes0 Down votes

7 views5 pagesOct 23, 2012

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

Attribution Non-Commercial (BY-NC)

7 views

Attribution Non-Commercial (BY-NC)

- Grade 11 Business Math Sample Questions
- fractions unit - vit
- A Sample Lesson Plan in Mathematics Grade Four Using Block m
- Weekly Update January 10th.pptx
- Fraction Lesson
- adding fractions short form lesson
- Online Fraction Teaching Concepts
- ch 3 summary
- Siddhi Times-Fortnight Edition - Masi 2009 - Dr.Commander Selvam
- Fractions and Decimals
- dear parents uoi 3 ccss
- HW2_sol
- topic 13 menu
- Expressing Fraction Form to Decimal Form
- solarfire_elecfire_cosmicfire
- Lagna (Ascendant)
- 9lpfeb9math-decimals
- Dip_Eng_Mark_Scheme_Level_3_Unit_8.pdf
- Venus in the Elements
- Size of Jems Stone

You are on page 1of 5

Before you begin Your main objective is to gain competencies in problem solving using the algorithmic approach and implementing these solutions using the C language. You would attend several face-to-face instructional sessions, learn from the interactive multimedia lessons from the Yogyata Portal, and also go through some online mentoring sessions. The fact, however, is that you would develop strong competencies in problem solving and ability to develop programs in C only when YOU practice problem solving and Learn by Doing! This is Set #1 of the Problems for Practice. By design, the level of difficulty of these problems is kept simple to average. You must attempt all these problems, write algorithms to solve them, write the corresponding C programs, compile them, and check whether this works as intended. Please do not be tempted to slip into complacency by skipping any of these problems or any of the problem-solving steps. Your journey to developing competencies in problem solving using algorithms and C begins here Best Yogyata Team

1 of 5

IT 311 Foundations of Algorithms & Problem Solving (using C) Problems for Practice Set #1

Problem 1.1

Kilograms to Pounds

The user inputs a persons weight in kilograms. It is desired to convert this weight into pounds. Then, the persons weight in kilograms and the weight in pounds must be printed as follows: Weight in Kilograms = 65.5 Weight in Pounds = 144.1

Write a C program that performs this task. Remember that a persons weight cannot be zero or negative.

Problem 1.2

Type of Triangle

Three real numbers supposed to represent the lengths of the three sides of a triangle are input. We must only accept such inputs that enable the formation of a triangle. Once a viable input of three sides of a triangle is available, we must find out whether the triangle is an equilateral triangle, isosceles triangle or a scalene triangle. Write a C program that read the input data, validates it as required, displays the input data, and displays what sort of a triangle it is. Note: A triangle is equilateral if all its three sides are equal. An isosceles triangle is one in which any of its two sides are equal. A scalene triangle is one in which all three sides are distinct.

Problem 1.3

In school, we have dealt with fractional numbers. For example, a number of the form 2/3 (pronounced as two-upon-three) is considered to be a proper fraction. Note that the numerator is always less than the denominator. A number of the form 23/3 (pronounced as twenty-three-upon-three) is considered to be an improper fraction. In this case, the numerator is greater than the denominator. An improper fraction can be converted into a mixed fraction. For example, 23/3 can be written as 7 2/3 (pronounced as seven-and-two-upon-three). You are required to take two integers representing the numerator and denominator as input, representing a fraction. Note that the fraction can be positive or negative depending on the sign of the numerator. You are required to display the inputs, and state what sort of a fraction it is. Further, if it is an improper fraction, you must convert this into a mixed fraction and print it. Write a C program that performs this task.

2 of 5

IT 311 Foundations of Algorithms & Problem Solving (using C) Problems for Practice Set #1

Problem 1.4

Many problems would require dealing with calendar dates, whether it represents today or someones birthday or data of joining an organization or whatever. A date is composed of three quantities that represent the day, month and year. In India, the most common method is to represent a date as dd/mm/yyyy. Here dd is a two digit positive decimal integer representing the day (which can be in the range [1,31] depending on the month it is associated with). The mm is a two digit positive decimal integer in the range [1,12]. The year is represented by a 4 digit positive decimal integer. You are required to take as input three different integers from the user, that ought to represent a date in the form dd/mm/yyyy. Whatever the user inputs, you are to validate the input as being a valid date. You must display the user input in the form dd/mm/yyyy, and also a message stating whether this represents a valid date or not. Note that while reading the three integers from the user, you are not required to read the / character. But while printing, you must include that character. Write a complete C program that performs this task.

Problem 1.5

A user enters three integers representing a date in the form dd/mm/yyyy. First this input must be validated, and only a correct date must be accepted. Your are required to display the input date in the form dd/mm/yyyy. Also, you must display the input date in an attractive manner as follows: The input date is 24/08/1956 An attractive display is 24 August 1956 Write a C program that takes as input three integers representing a date in the form dd/mm/yyyy, display the input as it is, and then display it in an attractive form as shown above.

Problem 1.6

The user enters a birthday in the form dd/mm/yyyy, which needs to be validated and accepted. Then the Zodiac Sign corresponding to that date must be printed, along with the input birthday. The Zodiac Sign to which a particular birthday belongs to is given in the following table.

3 of 5

IT 311 Foundations of Algorithms & Problem Solving (using C) Problems for Practice Set #1

From Date March 21 April 20 May 21 June 21 July 23 August 23 September 23 October 23 November 22 December 22 January 20 February 19

To Date April 19 May 20 June 20 July 22 August 22 September 22 October 22 November 21 December 21 January 19 February 18 March 20

Zodiac Sign Aries Taurus Gemini Cancer Leo Virgo Libra Scorpio Sagittarius Capricorn Aquarius Pisces

Write a C program that takes a birthday as input (note that we need to input only the day and month, since year is not required here) , prints the input in dd/mm form and states the Zodiac Sign of that person.

Problem 1.7

Two dates in dd/mm/yyyy form are taken as input from the user. The first date input must be earlier than the second date that is input. For example, the two valid dates can be 24/08/1956 and 225/09/2009. It is desired to calculate the total number of days that have elapsed between these two dates. You are required to write a C program that takes as input the two dates, prints the inputs, calculate the days elapsed between the two dates, and prints the days elapsed.

Problem 1.8

The user enters an amount of money as input integer in Indian Rupees. For example, the user may enter 22356, indicating that the amount is Rs. 22356. This input must be printed as 4 of 5

IT 311 Foundations of Algorithms & Problem Solving (using C) Problems for Practice Set #1

The input amount in figures is Rs. 22356 The amount in words is Rupees Twenty Two Thousand Three Hundred and Fifty Six Write a C program that takes the money input as integer and performs the above task.

Problem 1.9

A customer purchases merchandise from a shop for a certain amount of money in Indian Rupees. This amount is an integer amount and no Paisa is involved. The amount of money is read as input. The customer can pay that amount only using 500-rupee notes, since she has no other denomination with her. The number of 500-rupee note the customer must pay can be calculated and output. The shopkeeper has with her currency in the denominations of 500, 100, 50, 20, 10, 5, 2 and 1 rupee notes. You are required to write a C program that takes the bill amount as input, displays it, calculates the number of 500-rupee notes the customer has to give, displays it, and then computes the balance to be given. But the balance amount needs to be given to customer in the least number of currency notes. The results should be printed as follows: The amount on the bill = Rs. 234 Number of 500-rupee notes customer gives = 1 Balance to be returned = Rs. 266 Denominations returned: 100-rupee notes = 2 50-rupee notes = 1 10-rupee notes = 1 5-rupee notes = 1 1-rupee notes = 1

Problem 1.10

Two integers are input. The first one can be positive, negative or zero. The second one can be zero or positive, but not negative. For example, let the two numbers be 12 and 5. What we want to do is to form a real number of the form 12.5. If the input number is -25 and 557, the real number formed is 25.557. Write a C program that takes these two integer inputs, forms the real number, displays the two input integers and also the real number formed.

5 of 5

- Grade 11 Business Math Sample QuestionsUploaded byYnel Ef Zednandref
- fractions unit - vitUploaded byapi-356139696
- A Sample Lesson Plan in Mathematics Grade Four Using Block mUploaded byFrancis Maluntag
- Weekly Update January 10th.pptxUploaded byNiki Eskew Turco
- Fraction LessonUploaded byamf7279
- adding fractions short form lessonUploaded byapi-313636775
- Online Fraction Teaching ConceptsUploaded byWilliam K. McIntosh
- ch 3 summaryUploaded byapi-281124194
- Siddhi Times-Fortnight Edition - Masi 2009 - Dr.Commander SelvamUploaded bySiddhi Times
- Fractions and DecimalsUploaded byKaisha Medina
- dear parents uoi 3 ccssUploaded byapi-235660472
- HW2_solUploaded byIzza Nur Afifah
- topic 13 menuUploaded byapi-275333643
- Expressing Fraction Form to Decimal FormUploaded byrina galay
- solarfire_elecfire_cosmicfireUploaded bythings3
- Lagna (Ascendant)Uploaded byshunmugathason
- 9lpfeb9math-decimalsUploaded byapi-351706803
- Dip_Eng_Mark_Scheme_Level_3_Unit_8.pdfUploaded bySamantha Ashman
- Venus in the ElementsUploaded byRamram07
- Size of Jems StoneUploaded byshrishivankar
- Aljebraic FractionsUploaded byFuad Quazi
- pizza of the whole planUploaded byapi-325887051
- Rudolf Steiner - Warmth Course the Theory of HeatUploaded byarca
- Elementary Algebra BookUploaded byyenisuarez
- 10691170_4907275136476_1739782069_n.docxUploaded byLadylyn Escaner
- Class_3_Syllabus_2012-2013Uploaded byektadogra
- GlossaryUploaded bySyed Waqas Ahmed
- How to Solve Word Problems Involving RatioUploaded byAnonymous CKFeAdNukJ
- Grade 3 Math Games MeasurementUploaded byDale
- g4 mathematics florida standardsUploaded byapi-290541111

- 3.CSSLayoutUploaded byFazes
- 101202 6min London EnglishUploaded byjamescantebury
- Slang 1980sUploaded bydeb1954
- daaUploaded byVijay Kumar
- The Gratitude of Man and the Gratitude oUploaded bySayyid Omar Amiruddin Khan
- KierkergaardSicknessUntoDeathExcerptUploaded byaditya56
- Canadian EnglishUploaded byMr. doody
- Professional Knowledge IT Q.Uploaded byRAVI
- Kessler TomaselloUploaded bymafibel150
- Thesis Dissertation ChecklistUploaded bytheblazeoo7
- Document9_000.OfficeRecovery Online FullUploaded byManikantaBobbili
- assignment description memo and board meetingUploaded byapi-352250701
- HTML TutorialUploaded byJohn
- Writing (IMPRESO)Uploaded bygloria
- Doing Business in VietnamUploaded byMadalina Budescu
- Salary by RoleUploaded byapi-27067866
- Online Books HopingUploaded byManoj Kumar Jawlia
- Basic Setup GuideUploaded byImi Michał Smulski
- f2f Upper-Inter Vocabulary testUploaded byJasemyn Znjanko
- 25.1vaggione.pdfUploaded byandrehencleeday116
- Theory of Automata and Formal LanguagesUploaded byanuraggupta85
- ICS4M0 - Final Culminating ProblemsUploaded byakbisoi1
- 74als299Uploaded bymanuelpr
- Data_Structures(1-5) 2&16 MarksUploaded bypitchrks19841
- CTMS_ MATLAB Basics TutorialUploaded byMuhammad Enam ul Haq
- Fundamentals of BIOVIA Pipeline PilotUploaded byArun Kumar Cg
- Blueprint App Delivery Fundamentals ExamUploaded bycarljazz
- Daily DuasUploaded byMohamedi Miraji
- crystal structures of materials.pdfUploaded bySurbhi Aren
- Json Data TypesUploaded byShaunak Jagtap

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.