Programming

C languageC SolutionChapter 3Programming

Q22 In digital world colors are specified in Red-Green-Blue (RGB) format, with values of R, G, B varying on an interger scale from 0 to 255. In print publishing the colors are mentioned in Cyan-Magenta-Yellow-Black (CMYK) format, with values of C, M, Y, and K varying on a real scale from 0.0 to 1.0. Write a program that converts RGB color to CMYK color as per the following formulae: Note that of the RGB values are all 0, then the CMY values are all 0 and the K value is 1.

Program: 90 In digital world colors are specified in Red-Green-Blue (RGB) format, with values of R, G, B varying on

Read More
C languageC SolutionChapter 3Programming

Q20 The policy followed by a company to process customer orders is given by the following rules: (i) If order quantity is less than or equal to that in stock and his credit is ok, supply his requirement. (ii) If his credit is not ok do not supply. Send him intimation. (iii) if his credit is ok but the item in stock is less than his order, supply what is in stock. Intimation him that balance will be shipped later. Write a C program to implement the company policy.

Program: 88 The policy followed by a company to process customer orders is given by the following rules: (i) If

Read More
C languageC SolutionChapter 3Programming

Q19 In a company, worker efficiency is determined on the basis of time required for a worker to complete a particular job. If time taken by the worker is between 2-3 hours, then the worker is said to be highly efficient. If time required by the worker is between 3-4 hours, then the worker is ordered to improve speed. If time taken is between 4-5 hours, the worker is given training to improve his speed, and if time taken by the worker is more than 5 hours, then the worker is terminated. If the time taken by the worker is input through the keyboard, write a program to find the efficiency of the worker.

Program: 87 In a company, worker efficiency is determined on the basis of time required for a worker to complete

Read More
C languageC SolutionChapter 3Programming

Q16 A library charges a fine for every book returned late. For first 5 days the fine is 50 paise per day, for 6-10 days fine is one rupee per day and above 10 days fine is 5 rupees per day. If you return the book after 30 days your membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine appropriate message.

Program: 84 A library charges a fine for every book returned late. For first 5 days the fine is 50

Read More