In a local government meeting, community leaders are required to identify one SDG, out of the 17 goals, that is most important to local PNG communities. Each community leader is required to select their goal of choice only once. The vote is recorded as a number from 1 to 17. The number of community leaders voting is unknown beforehand, so the votes are terminated by a value of zero (0). Votes not within and not inclusive of the numbers 1 to 17 are invalid (spoilt) votes. A file, sdGoals.txt contains the list of goals. The first goal is listed as SDG 1, the second as SDG 2 and so forth. The goals are followed by the number of votes for the goal.
Write a program to read the data and evaluate the results of the selection. Print all the output to a file called sdgSelection.txt
The program output should specify the total number of votes and the number of invalid votes. This is followed by the votes received for each SDG and the winning (top) selection SDG.
In a local government meeting, community leaders are required to identify one SDG, out of the 17 goals, that is most important to local PNG communities. Each community leader is required to select their goal of choice only once. The vote is recorded as a number from 1 to 17. The number of community leaders voting is unknown beforehand, so the votes are terminated by a value of zero (0). Votes not within and not inclusive of the numbers 1 to 17 are invalid (spoilt) votes. A file, sdGoals.txt contains the list of goals. The first goal is listed as SDG 1, the second as SDG 2 and so forth. The goals are followed by the number of votes for the goal.
Write a program to read the data and evaluate the results of the selection. Print all the output to a file called sdgSelection.txt
The program output should specify the total number of votes and the number of invalid votes. This is followed by the votes received for each SDG and the winning (top) selection SDG.
a C program that declare an array of five characters using a WHILE loop and sort the elements in row one in alphabetical order using a nested FOR loop and IF statement and print the sorted characters using a WHILE loop
Write a program that receives one command line argument: the name of a text file. Your program will work as follows:
Start out by creating a child process.
The child process calls exec to run cat command with command line argument that the parent received.
Write a program to read two alphabetical characters and print all the characters in-between them including the given ones. Consider the 26 alphabets in cyclic order.
Note: use lower case letters for input and output.
For example:
Test Input Result
1 k o k l m n o
2 y a y z a
For a given number N(0<N<100), little johnny wants to find out the minimum positive integer X divisible by N,where the sum of digits of X is equal to N,and X is not equal to N
Write a menu driven program which has the following options:
1. Factorial of a number
2. Prime or not
3. Odd or Even
4. Exit
Once a menu item is selected the appropriate action should be taken and once
this action is finished, the menu should reappear. Unless the user selects the “Exit”
option the program should continue to work.
While purchasing certain items, a discount of 10% is offered if the quantity
purchased is more than 1000. If quantity and price per item are input through the
keyboard, create a program on it
A man takes a job for 30 days. His pay for the first day is calculated as square
of his joining date. Assume he’s
joining on 3rd of the month, then his starting
pay is Rs 9/. After that his pay for the consecutive days are twice the pay of
previous day .i.e. each day’s pay is twice the pay of previous day. Write a c
program using functions to find his total pay for 3
0 days.
An online retailer sells five different products, whose retail prices are shown in
the following table:
Product number
Retail price
1
$2.98
2
$4.50
3
$9.98
4
$4.49
5
$6.87
Write a C program that reads a series of pairs of input as follows:
a.
Product number
b.
Quantity sold for one day
Write a program to help and determine the retail price for each product. Calculate
and display the total retail
value of all produ