Submitted Questions

  • Arrays

    Design a flow chart for program that displays the number of days in each month. the program should have two parllel arrays 12 element string array that is initialized with the names of the month, and 12 element integer array that is initialized the number of days in each month.

    Cassandra Blackburn

    • Sep 9th, 2013

    Jan Month have 31 Days Feb Month have 28 days March Month have 31 Days April Month have 30 Days
    May Month have 31 days June Month have 30 Days July Month have 31 days Aug Month have 31 Days
    Sept Month have 30 Days Oct Month have 31 Days Nov Month have 30 days Dec Month have 31 Days

    Ponni Vaithiyanathan

    • Aug 20th, 2013

    Jan Month have 31 Days feb Month have 28 Days March Month have 31 Days April Month have 30 Days May Month have 31 Days June Month have 30 Days july Month have 31 Days Aug Month have 30 Days sep Month ...

  • flow

    Number analysis program design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: the lowest number in the arraythe highest number in the array the total of the numbers in the arraythe...

    Lohitha

    • Jul 30th, 2016

    Code
    1. #include<stdio.h>
    2. int main()
    3. {
    4.         int a[20],i,min,max,count=0;
    5.         printf("enter elements into array:");
    6.         for(i=0;i<20;i++)
    7.         scanf("%d",&a[i]);
    8.         min=a[0];
    9.         for(i=0;i<20;i++)
    10.         {
    11.                 if(a[i]<min)
    12.                 min=a[i];
    13.         }
    14.         max=a[0];
    15.         for(i=0;i<20;i++)
    16.         {
    17.                 if(a[i]>max)
    18.                 max=a[i];
    19.                 count++;
    20.         }
    21.         printf("minimum value is:%d
    22. ",min);
    23.         printf("maximum value is:%d
    24. ",max);
    25.         printf("Number of elements in an aray:%d
    26. ",count);
    27.         return 0;
    28.        
    29. }

  • Analysis Number Design Flow chart

    Number analysis program design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: the lowest number in the array,the highest number in the array and the total of the numbers in the array...

    Michael Brown

    • Apr 1st, 2014

    "c numlist = [-7,1,2,45289, 7,5,9,7,4,-10,34,234345678,32,12,1566,0,8,5,4,2] sum = 0 current = numlist[0] high = numlist[0] low = numlist[0] current = numlist[0] for i in rang...

  • Logic and Design

    Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: • The lowest number in the array • The highest number in the array • The total of the numbers in the array • The average of the numbers in the array

    Teja

    • Oct 8th, 2017

    int arr[] = {4,2,6,1,7,12,10,11}; int min= arr[0]; int max= arr[0]; int total = 0; int avg; for(int i=0; i arr[i]) { min = arr[i]; } else if(max < arr[i]) { max = arr[i];...

    Shubhangi

    • Oct 5th, 2017

    I inserted a code but how to get exact decimal point answer for avg,I didnt get .

    Code
    1. #include<stdio.h>
    2. main()
    3. {
    4. int arr[10];
    5. int i,size;
    6. size=sizeof(arr)/sizeof(arr[0]);
    7. printf("enter the array elemrnt......
    8. ");
    9.  
    10. for(i=0;i<size;i++)
    11. //scanf("%d",&arr[i]);
    12. arr[i]=rand()%100;
    13.  
    14. for(i=0;i<size;i++)
    15. printf("%d      ",arr[i]);
    16. ");
    17.  
    18. //lowest number....
    19. int temp=arr[0];
    20. for(i=1;i<size;i++)
    21. {
    22. if(temp>arr[i])
    23. temp=arr[i];
    24. else
    25. continue;
    26. }
    27. printf("lowest element=%d
    28. ",temp);
    29. //highewst numer
    30.  temp=arr[0];
    31. for(i=1;i<size;i++)
    32. {
    33. if(temp<arr[i])
    34. temp=arr[i];
    35. else
    36. continue;
    37. }
    38. printf("highest element=%d
    39. ",temp);
    40.  
    41. //toatal of numbers
    42. int sum =0;
    43. for(i=0;i<size;i++)
    44. {
    45. sum=sum+arr[i];
    46. }
    47. printf("total of an array:%d
    48. ",sum);
    49. //average
    50. int avg;
    51. avg=sum/size;
    52. printf("average=%d
    53. ",avg);
    54.  
    55. }
    56.  

  • Functions

    1.One foot equals 12 inches. Design a function named feetTolnches that accepts a number of feet as an argument, and returns the number of inches in that many feet. Use the function in a program that prompts the user to enter a number of feet and then displays the number of inches in that many feet. 2.Rainfall Statistics Design a program that lets the user enter the total rainfall for each of 12 months...

    Sunil shenoy

    • May 16th, 2016

    Code
    1. #include<iostream>
    2. using namespace std;
    3. float ft_to_inch(float ft)
    4. {
    5.     return ft*12;
    6. }
    7. main()
    8. {
    9.     float f,i;
    10.     cout<<"Enter a Feet value:"<<endl;
    11.     cin>>f;
    12.     i=ft_to_inch(f);
    13.     cout<<"result in Inches: "<<i<<endl;
    14. }

    George

    • Jul 29th, 2014

    In Haskell (please excuse syntax highlighting; they dont have it for this language):"css -- feetToInches.hs module Main where feetToInches :: Num a => a -> a feetToInches = (*12) ...