write a program (wap)to print the largestof threenumbers
Using exec system call list all the files and directories of home then
store the result in “output1.txt”. Run a second command “grep” and find
the word “output1.txt” in all the text files of the home also place the home
path in the “PATH” environment variable while doing exec for grep. This all
will be done in one process.
Write a C++ program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet, hot, and zesty.
The program should use two parallel 5-element arrays: an array of strings that holds the five salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created.
The program should prompt the user to enter the number of jars sold for each type. Once this sales data has been entered, the program should produce a report that displays sales for each salsa type, total sales, and the names of the highest selling and lowest selling products.
Input Validation: Do not accept negative values for number of jars sold.
Write a C++ program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet, hot, and zesty.
The program should use two parallel 5-element arrays: an array of strings that holds the five salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created.
The program should prompt the user to enter the number of jars sold for each type. Once this sales data has been entered, the program should produce a report that displays sales for each salsa type, total sales, and the names of the highest selling and lowest selling products.
Input Validation: Do not accept negative values for number of jars sold.
Write a C++ program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election
Pattern
A teacher asked Ramesh to draw a Quadrilateral of a specific pattern with only symbol. The length and height should be L. Here L is the number of characters in every line. The height of the
*
quadrilateral is the number of lines it contains.
The slope of the quadrilateral taken as S represents the the number of extra space characters in a line when compared to its next line.
The last line will not have any space characters before the character.
Sample Input
6
9
Sample Output1
******
******
******
******
******
******
Find latitude and longitude of first 20 countries with a population greater than or equal to the population limit given below. Use the country details from this dataset ( https://cdn.jsdelivr.net/gh/apilayer/restcountries@3dc0fb110cd97bce9ddf27b3e8e1f7fbe115dc3c/src/main/resources/countriesV2.json ).
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Population limit: 11750
Matrix Problem
you are given an m*n matrix.write a program to compute the perimeter of the matrix and print the result.Perimeter of a matrix is defined as the sum of all elements of the four edges of the matrix.
Input
The first line of input containing the positive integer.
The second line of input containing the positive integer.
The next N lines of input space-separated integers.
Explanation: The input should be
3
4
1 2 3 4
5 6 7 8
9 10 11 12
The output should be 1+2+3+4+8+12+11+10+9+5 = 65
Sample Input1
4
4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Sample Output1
1+2+3+4+8+12+16+15+14+13+9+5=102
Design and implement a program that computes final averages for a set of grades. The program reads the grades from a user. (10) The format of a grade line is: N grades1, grades2, …………., grades5 Where N is total number of students and grades is the ith score. All scores must be between 0 and 100. The program reads the grades from the user, calculate and display the average
The weighted average is computed as:
NB: Your program should validate its input. That is, it should make sure each score is between 0 and 100 and that each student has n scores/ grades. If a student’s grades are invalid, the program should display an error message. The program should contain modules / functions that handles validating the input
Minimal Absolute Difference
There are N pyramids in a line.You are given their heights as a list of integers.Write a program to find the minimum absolute difference between the heights of any two different pyramids.
Input
The input is a single line containing space-separated integers.
Output
The output should be a single line containing the minimum absolute difference of any two different pyramid heights.
Explanation
Given Pyramid heights are 7 1 5.
The absolute difference between the heights of any two different pyramids are