# CSP2151 Workshop 3 Assignment

```Edith Cowan University
School of Science
```

## CSP2151 Workshop 3

### Design the following:

1. Write a function int_max_3 that takes three int arguments and returns the largest of them as the value of the function.
2. The function islower() returns true if its int argument is a lowercase character. Write your own version of islower() called myislower().
3. Write your own version of toupper(), also in ctype.h, which converts lowercase letters to uppercase letters, and leaves all other characters unchanged. Bonus (no assistance on this one!):
4. Write a function int logstar(double) that calculates this function.

log x * {1 + log * (log2x) if x ≤ 1 otherwise

### Design and Implement the following:

1. Write a function cube_root that receives a double argument and calculates and returns an approximate cube root for it. You should also write a main program that allows you to test your function.
2. Write a function that reads integers until it obtains one in the range given by its first two arguments. When a suitable value is read, it stores that value using its third argument, and returns the predefined constant READ_OK . If no suitable value is located, the predefined constant READ_ERROR should be returned.

Assessable:

1) Design with either pseudocode or flowcharts and extend your previous lunar lander program to do the following:

You are now to use two functions:

float Delta_V(float, int, float*) takes the velocity, thrust and a pointer to the altitude of the lander capsule as arguments, calculates the new velocity, modifies the altitude pointer to the new height and then returns the new velocity.

int Check_Status(float, float) takes the velocity and altitude of the lander capsule and checks to see what the status of the module is. If the capsule is still falling it should return 0. If the capsule has landed it should return 1. If the capsule has crashed it should return 2.

Triangular numbers are used to describe the pattern of dots that form larger and larger triangles. The sequence can also be described as:

 0 + 1 = 1 1 + 2 = 3 3 + 3 = 6 6 + 4 = 10

2) Design with either pseudocode or flowcharts , using either pseudocode or a flowchart, a program that :

• Takes a number from the console
• Prints every Triangle number from 1 to that number
• If the number happens to also be a Prime number, do not print the Triangle number and normal and instead print “ Prime Number: N !” where N is the Prime Triangle number.

### + Submit Your Assignment Here

#### AssignmentHippo Features

##### On Time Delivery

Our motto is deliver assignment on Time. Our Expert writers deliver quality assignments to the students.

##### Plagiarism Free Work

Get reliable and unique assignments by using our 100% plagiarism-free.

##### 24 X 7 Live Help

Get connected 24*7 with our Live Chat support executives to receive instant solutions for your assignment.

##### Services For All Subjects

Get Help with all the subjects like: Programming, Accounting, Finance, Engineering, Law and Marketing.

##### Best Price Guarantee

Get premium service at a pocket-friendly rate at AssignmentHippo

#### Client Review

I was struggling so hard to complete my marketing assignment on brand development when I decided to finally reach to the experts of this portal. They certainly deliver perfect consistency and the desired format. The content prepared by the experts of this platform was simply amazing. I definitely owe my grades to them.