Answer:
C
Explanation:
I believe that's the answer if it's not sorry
If someone wants to put data in order (ascending or descending) they should sort the data.
c. Sort
<u>Explanation:</u>
Sorting is the process of arranging the data on the basis of some property or attribute. Using the find command, conducting a query, and mapping the data would not help.
There are various sorting algorithms like the bubble sort, selection sort, insertion sort, quick sort, and merge sort. Out of all the attributes, one or a combination of attributes can be selected to serve as the basis for sorting.
Answer: Result:Enter the number of quarters in the jar: 4
Enter the number of dimes in the jar: 5
Enter the number of nickels in the jar: 2
Enter the number of pennies in the jar: 5
Total value is 1 dollars and 65 cents
Explanation: import java.util.Scanner;public class Coins { public static void main(String[]args) { int quarters, dimes, nickels, pennies; int total;Scanner scan = new Scanner (System.in);System.out.print("Enter the number of quarters in the jar: "); quarters = scan.nextInt();System.out.print("Enter the number of dimes in the jar: ");dimes = scan.nextInt(); System.out.print("Enter the number of nickels in the jar: ");nickels= scan.nextInt(); System.out.print("Enter the number of pennies in the jar: ");pennies = scan.nextInt(); int total_cents = 25*quarters + dimes*10 + nickels*5 + pennies;total =total_cents/100;total_cents = total_cents %100;System.out.println("Total value is " + total + " dollars and " + total_cents + " cents ");}}
Result:Enter the number of quarters in the jar: 4
Enter the number of dimes in the jar: 5
Enter the number of nickels in the jar: 2
Enter the number of pennies in the jar: 5
Total value is 1 dollars and 65 cents
In the C programming language, you can't determine the array size from the parameter, so you have to pass it in as an extra parameter. The solution could be:
#include <stdio.h>
void swaparrayends(int arr[], int nrElements)
{
int temp = arr[0];
arr[0] = arr[nrElements - 1];
arr[nrElements - 1] = temp;
}
void main()
{
int i;
int myArray[] = { 1,2,3,4,5 };
int nrElements = sizeof(myArray) / sizeof(myArray[0]);
swaparrayends(myArray, nrElements);
for (i = 0; i < nrElements; i++)
{
printf("%d ", myArray[i]);
}
getchar();
}
In higher languages like C# it becomes much simpler:
static void Main(string[] args)
{
int[] myArray = {1, 2, 3, 4, 5};
swaparrayends(myArray);
foreach (var el in myArray)
{
Console.Write(el + " ");
}
Console.ReadLine();
}
static void swaparrayends(int[] arr)
{
int temp = arr[0];
arr[0] = arr.Last();
arr[arr.Length - 1] = temp;
}