Questions: 1 978

Answers by our Experts: 1 850

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program/method to compare two neighboring numbers in an array when the first index is given.Now combine the above two methods and implement bubble sort algorithm. You must call the above two methods in your sorting program.Now test your sorting program with a random number array generator you created 2


Test that array with both selection sort and bubble sort.Compute the time taken for each algorithm to complete.Repeat step two and three for 1000, 10000, 100000, and 1000000 random numbers.Plot the results in a graph


Write a program that will input student’s information (i.e. name, id, cgpa) who have enrolled

for CSE-207 course in Summer 2020. You have to declare a pointer variable to input the

information and dynamically allocate memory for storing information of each student. After

taking input find out the student name who has obtained the highest GPA.


Write a program that will delete all negative number by using Pointer. You have to declare a

pointer array and dynamically allocate memory to input elements of array.


The purpose of a sorting algorithm is to order/categorize set of items within a series of items.


Write a program/method to swap two neighboring numbers in an array when the first index is given.

Write a program that calculate the cost of energy for energy units restricted between 0 to 500 kWh for an amount less than $6 000.00 for any Zimbabwean resident customer and any amount and unlimited number of units for a foreign resident customer buying from outside Zimbabwe at a rate of $90.00 to one USD. The tariffs are as follows:



• 0 to 50 kWh cost $2.25



• Above 50 kWh to 100 kWh cost $4.51 / kWh



• Above 100kWh to 200 kWh cost $7.89 / kWh



• Above 200kWh to 300 kWh cost $11.25 / kWh



• Above 300kWh to 400 kWh cost $12.94 / kWh



• Above 400 kWh cost $13.50 / kWh

2. Using the online compiler •

Enter the code

int main(int argc, char *argv[]) {
	
	byte_t first_byte = 128;
	byte_t second_byte = 1;
	int    shift;
	
	printf("Enter the number of left/right shifts: ");
	scanf("%d", &shift);
	printf("\n\n");
	
	// Right-shift first_byte
	first_byte = first_byte >> shift;
	
	// Left-shift second byte
	// This is the equivalent of second_byte = second_byte << shift; 
	second_byte <<= shift;		
	
	// Display the results
	printf("128 >> %d = %d\n", shift, first_byte);
	printf("1 << %d = %d\n", shift, second_byte);
	
	system("pause");
	return 0;
}


You will be prompted to enter a value for the number of shifts. Initially enter the value of zero

Repeat the previous two steps with values of 1, 2, 3, 4, 5, 6, 7 and 8


10. Using the online compiler

• Write a program using a for loop that counts upwards from 0 to 100 in steps of 2.



9. Using the online compiler

• Write a program that counts down from 100 to 0 using a for a loop.




8. Using the online compiler

• Write a program that counts upwards from 0 to 100 using a for a loop. •



LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS