Need this for Visual Basic The GUI for this project will have several labels and
ID: 3569660 • Letter: N
Question
Need this for Visual Basic
The GUI for this project will have several labels and a button.
When the button is clicked, you will generate an array that contains 10 random numbers between 1 and 100.
Display the 10 random numbers in sorted order on a label.
On another label display the sum of the numbers in the array.
Then on a final label display the average of the number in the array.
For full credit, write functions to determine the sum and average values. The button click event procedure will pass the array to the FindSun function and FindSum will return the sum of the values in the array. Do a similar thing with FindAverage
Be sure to handle the labels and variables appropriately so that the user can click on the button multiple times.
Explanation / Answer
Program
65 to 90 is A-Z ascii values
97 to 122 is a-z ascii values
================================
#include<stdio.h>
int main()
{
char str[200];
int i=0;
int startWord=1;
printf("Please enter a string >");
fgets(str, sizeof str, stdin);
while(str[i]!='')
{
if((str[i]>=65 && str[i]<=90)
|| (str[i]>=97 && str[i]<=122))
{
//If startWord is 1 then it is new word
if(startWord==1)
{
if(str[i]>=97 && str[i]<=122)
{
str[i] = str[i] -32;
}
startWord = 0;
}
}
else
{
startWord=1;
}
i++;
}
printf("%s",str);
}
===========================================================
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.