Question: The programming language is C. Develop a program to calculate a piecewise function. Input Specification: Input a decimal number (real number) for x Output Specification:

The programming language is C.

  1. Develop a program to calculate a piecewise function.

Input Specification: Input a decimal number (real number) for x Output Specification: Output the value of x and y. keep 5 decimal numbers. Seperate by ',' Sample Input: 10.2 Sample Output:

x=10.20000,y=0.09804

  1. Digit Statistics Given a positive integer, count how many times each different single digit appears. Input Specification: Positive integer. Output Specification: On each line, output D:M. Here, D is the digit, M is how many times D appears in the integer. D is in ascending order on different lines. Sample Input: 100811 Sample Output: 0:2 1:3 8:1
  2. Calculate employee salary Given the information of N employees, including name, basic salary, floating salary and expenditure, you are required to write a program to output the name and actual salary of each employee in given order (actual salary = basic salary + floating salary-expenditure). Input format: The first line is the number of employees. For the following N lines, each line gives information about one employee. The name, basic salary, variable salary and expenditure are separated by one space. The name is non-empty string with length less than 10 and does not contain blank characters. Output format: According to the input sequence, each line outputs the name and actual salary of an employee, separated by one space, and the salary keeps 2 decimal places. Input sample: 3 zhao 240 400 75 qian 360 120 50 zhou 560 150 80 Output sample: zhao 565.00 qian 430.00 zhou 630.00
  1. Find two numbers Develop a program that you suppose to find two numbers in an array. The two numbers' sum is a

constant. The size of the array is 10. Input Specification: Input 10 numbers in the first line. Input a number at the second line to be the constant (the sum of two numbers) . Output Specification: Output 2 numbers each line. Sample Input: 81 78 80 67 85 42 86 82 90 79 160 Sample Output: Write the corresponding sample output here. For example: 81 79 78 82

  1. Count words Input several words, separate by space/tab, count how many words within your input. Input Specification: Input several words, separate by spaces or tab, end by enter key (<100 characters) . Output Specification: output the number of words Sample Input: this is the first time you're flying by yourself Sample Output: 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!