Skip to main content

Posts

STRUCTURE:BUILDING Structures : Building Create a structure called Building. struct Building { char name[100]; float length; float width; float height; float ratePerSqFt; }; Write a program to get the details of 'n' buildings and to display the name, area and rate for painting the inner side of the building per square feet of each building, sorted by name in ascending order. Length, width and height of the building are given in feet. The flooring is also done with the same rate. Input and Output Format: Refer sample input and output for formatting specification. All float values are displayed correct to 2 decimal places. All text in bold corresponds to input and the rest corresponds to output. Sample Input and Output: Enter the number of buildings 2 Enter the details of building 1 Enter name Vikram Enter length 200 Enter width 150 Enter height 10 Enter rate per square feet 650.5 Enter the details of building 2 Enter name Ganesh Enter length 1...
Recent posts
CROP STRUCTURE Crop structure Jack is an application software developer recently he has been assigned to a new project for crop management by the government. Actually, his task is to develop an app which will maintain the crop details like required rainfall, the temperature suitable for the growth of the plant, sow date, and harvest date. The Government would need to plan the budget for crops during the start of the financial year, for which required water quantity, pesticide, infrastructure to maintain temperature all are factors that affect harvest date of a crop. So help Jack in building filters by temperature and rainfall and sort the crops by sow date, harvest date. This will help the government to plan budget according to the sow and harvest date. Create a structure called Date. struct Date{ int dd; int mm; int yyyy; }; Create a structure called Crop. struct Crop{ char name[30]; float rainfall; int temperature; Date sowDate; Date ...
CROP DETAILS Crop Details A small farmer, Mr.John, use to grow different crops every year in his field. All the crops are being grown using goat manure, farmyard manure, groundnut and neem cake. All the crops are grown organically. He got high yield by using sufficient water and fertilizers at in this year. He will sell his crops in the market. In the market, he wants to maintain the details of each crop that are purchased by customers. Details like crop name, the weight of the crop, cost of the crop Display the details of crops in ascending order of crop names. Create a structure called crop. struct crop{ char cropName[30]; float weight; int cost; }; Input and Output Format: Refer sample input and output for formatting specification. All float values are displayed correctly to 2 decimal places. All text in bold corresponds to the input and the rest corresponds to output. Sample Input and Output: Enter the number of Crops 2 Enter the details of Crop 1 Enter name...
EXAMINATION SCAM 3 Examination Scam 3 Now a days in online examination there has been many fraudulent activities.Since online examination takes place virtualy its easy for the corrupts to gain money from it. One such fraudulent activity is providing fake registration links to the participants and collecting the fee from them.Due to this activity the legitimate online examination boards are hindered.As they are the once held responsible for the fees collected.There is also the case of an applicant registering using fake credentials.Applying more then once for a particular examination. To curb such bogus registration, the government has decided to tag the Aadhar number with every application. Then it collates the list of Aadhar numbers available in all application in the region. The authorities want to detect whether a particular Aadhar number appears multiple times in the list. Can you help them by writing a program to count the number of times 5 appears in an array? Note :...
EXAMINATION SCAM 1 Examination Scam 1 Now a days in online examination there has been many fraudulent activities.Since online examination takes place virtualy its easy for the corrupts to gain money from it. One such fraudulent activity is providing fake registration links to the participants and collecting the fee from them.Due to this activity the legitimate online examination boards are hindered.As they are the once held responsible for the fees collected.There is also the case of an applicant registering using fake credentials.Applying more then once for a particular examination. To curb such bogus registration activity,the online examination board has decided to allot a random number to each applicants. This random number is valid only if it contains a specific number of 5’s. (digit 5). Can you help them by writing a program to count the occurrences of 5 as a digit in the random number ‘n’ that is generated? Note : Formulate a RECURSIVE Algorithm Function name: int f...
COMBINATION OF CROPS Combination Of Crops John is a young farmer. He practiced precision farming in turmeric and he sowed the turmeric rhizomes after plowing the land well. He also grew onion, coriander, chilies, and red gram as intercrops. He got high yield by using sufficient water and fertilizers at a correct time. From the profit, he purchased N number of fields.So he is planning to grow different crops in that purchased fields. There are 'n' fields and 'r' crops. Help him to find the total number of different combinations in which the crops can be planted in the purchased fields. Hint: Use the formula nCr = (n-1)Cr+(n-1)C(r-1). Note: Function name: int combination(int n,int r); Input Format: The first input is an integer which corresponds to the 'n' value indicates a number of fields. The second input is an integer which corresponds to the 'r' value indicates a number of crops. Output Format: The output is an integer that corresponds to...
TOTAL Total One day John bought a bag full of different variety of apples. He wanted to sell them, but he doesn't know the total number of apples in the bag. He asks for Jack's help to find the total number of apples in the bag. Write a program to find the total number of apples using recursion. Note : Formulate a RECURSIVE Algorithm. Note: 1) Use the function, int sumOfArray(int *a,int n), with 2 parameters. First parameter is an integer pointer(representing the array), and the second paramenter is an integer(representing the size of the array). 2) Use malloc method to create the array. Input Format: The first line of input consists of integer 'N' (number of a variety of apples). The second line of input consists of 'N' values (number of apples of each variety). Output Format: The output consists of integer (total sum). Sample Input: 4 2 3 2 1 Sample Output: 8 #include #include #include int sumOfArray(int *a,int n) { if(n