ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 11 Weeks Ago, 6 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 06 Jun 2017 My Price 9.00

Write a program in C that will print the following using only loop

Part A: 10 pts

 

Write a program in C that will print the following using only loop.

 

**********

**********

**********

**********

**********

 

Part B: 10 pts

 

Write a program in C that will print the following using only loop.

 

        *

      **

    ***

  ****

*****

 

Part C: 10 pts

 

Write a program in C that will print the following using only loop.

 

 

*            *

**         **

***      ***

****   ****

**********

 

Part D: 10 pts

 

// Program to reverse the digits of a number

 

#include <stdio.h>

 

int main ()

{

     int  number, right_digit;

 

     printf ("Enter your number.n");

     scanf ("%i", &number);

 

     do {

         right_digit = number % 10;

         printf ("%i", right_digit);

         number = number / 10;

     }

     while ( number != 0 );

 

     printf ("n");

 

     return 0;

}

 

The given program will accept an user input and display the reversed digits (ie. if the user entered 593 then it would display 395).  However, this program does not function well if you type in a negative number. Find out what happens in such a case and then modify the program so that negative numbers are correctly handled. For example, if the number −8645 is typed in, the output of the program should be 5468−.

 

 

Part E: 10 pts

 

Write a program that calculates the sum of the digits of an integer. For example, the sum of the digits of the number 2155 is 2 + 1 + 5 + 5 or 13. The program should accept any arbitrary integer typed in by the user. You should keep excepting user entry until the user types in a negative number (i.e. -1 or -2.)

 

 

Due Date:   February 29th 2016 by Midnight

 

 

 

 

Requirements:

1. The program must follow the indentation rules. (use the provided code snippet in Assignment 3 as guide)

2. The program must be properly documented. (use the provided code snippet in Assignment 3 as guide)

3. All the declaration must be meaningful not just gibberish. (use the provided code snippet in Assignment 3 as guide)

4. Develop an algorithm to accomplish the coin counter challenge and implement it.

5. You may not use your classmate's algorithm as your own.

6. You may not copy an algorithm you found on the internet.

Answers

(11)
Status NEW Posted 06 Jun 2017 04:06 AM My Price 9.00

-----------

Not Rated(0)