Write a C program that read numbers from an integer array and graph the information in the
form of bar chat. Sample output is given below.
Element Value Histogram
0 19 *******************
1 3 ***
2 15 ***************
3 7 *******
4 11 ***********
5 9 *********
6 13 *************
7 5 *****
8 17 *****************
9 1 *
A car completes its journey in three parts. It travels the first X km of its journey at an average
speed of x_Speed m/s and the next Y km at an average speed of y_Speed km/h. The car completes the
last part of its journey at an average speed of z_Speed km/h in z_Minutes minutes. Here X, x_Speed, Y,
y_Speed, z_Speed, and z_Minutes are all variables whose values you will have to take as an input from the
user. Find the average speed for its entire journey, giving your answer in km/h.
speed =
distance
time
Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray).
Given values for red, green, and blue, remove the gray part.
We Filipinos are quite known for the habit
of leaving at least one of the many pieces
of food on the plate as it can't be equally
divided among all at most times. Just like
when 3 people decide to eat a pizza of 10
Slices, there will often be at least one slice
left on the box. To accurately show just
how many pieces of things are left when
divided by a certain number, we code it
using modulo.
Care to do it for me?
Input
A line containing two integers separated
by a space.
10 3
Output
A single line containing an integer.
Planning in forms of Pseudocode and Flowcharts for a Vending machine
Body Mass Index (BMI) is one of the criteria that is used to calculate whether one is fit or not basing on a person’s height (m) and weight (kg). The criterion is very simple; if one’s BMI is 25 or greater, it signifies overweight. A BMI less or equal to 18.5 indicates underweight. Lastly, a BMI greater than 30 shows obesity.
You have been requested to create a program that that helps the Namibian Defence Forces’ (NDF) Captain to calculates the BMI of a person (BMI = weight/height2) and also determine whether the person has also completed running 10 km in the required time. Men should complete 10km in less than 60 minutes for them to be accepted. Women should do that under 80 minutes. Both males and females are accepted if their BMI is less than 25 and greater than 18.5. For 2018 intake, there are already 6 males selected and 1 female. The values for gender, mass and weight are enter by user inputs
// declare variables
int inpMark;
string lastName;
char grade = MarkToGrade;
// enter the student's last name
Console.Write("Enter the last name of the student => ");
lastName = Console.ReadLine();
// enter (and validate) the mark
do
{
Console.Write("Enter a mark between 0 and 100 => ");
inpMark = Convert.ToInt32(Console.ReadLine());
} while (inpMark < 0 || inpMark > 100);
question1
*// Use the method to convert the mark into a letter grade
grade = MarkToGrade();
// declare variables
int inpMark;
string lastName;
char grade = MarkToGrade;
// enter the student's last name
Console.Write("Enter the last name of the student => ");
lastName = Console.ReadLine();
// enter (and validate) the mark
do
{
Console.Write("Enter a mark between 0 and 100 => ");
inpMark = Convert.ToInt32(Console.ReadLine());
} while (inpMark < 0 || inpMark > 100);
* // Use the method to convert the mark into a letter grade
grade = MarkToGrade();
question is to use the method to convert the mark into a letter grade
Lets create your first cipher!!! Cipher is an algorithm that you can use to encrypt and decrypt
sensitive information. In an information system, sensitive information is stored in a 16-bit unsigned
number, where bit-wise information is stored in following format, 9-bits are reserved for account number
and 7-bits are reserved for customer ID.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
C C C C C C C A A A A A A A A A
a) Using bit wise operators, write a function to extract customer ID
b) Another function to extract account number.
c) Due to security concerns, you have been given a task to create a cipher. Write a function to
encrypt the 16-bit number (X) using the following expression.
y = aX + b, consider a = 5 and b = 233
d) Write another function to decrypt the number and display the original number.