Questions
Programmer defined Function / Arrays: 1.Write a function for printing an array. void print_array (int arr[],...

Programmer defined Function / Arrays: 1.Write a function for printing an array. void print_array (int arr[], int size); 2. Write a function to generate an array of random integers. void random_array (int arr[], int size, int range); The scale of numbers should be 1 to range. 3. Write a function to find the sum of a sequence of number. int sum (int arr[], int size); 4. Write a function rotate(arr[], d, n) that rotates arr[] of size n by d elements. Example: Rotation of the above array by 2 will make array. In your main function, call the above functions:  Declare an array of size that input by user.  Initialize this array with random values. (task 2)  Display this array. (task 1)  Display the sum of the numbers in the array. (task 3)  Ask user for number of elements to rotate ‘d’.  Call the user defined function named ‘rotate’. (task 4)  Display the array again.

In: Computer Science

#include <stdio.h> #include <stdlib.h> #include <math.h> #include "../include/cis1057.h" /* * Programmer: << MA >> * Class:...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "../include/cis1057.h"

/*
* Programmer: << MA >>
* Class: Introduction to C Programming 1057 Spring 2019
Section 004
* Assignment: Number 5 “estimate the value of a factorial using Gosper's algorithm."
* Date: << 02-19-2019 >>
* Version: 1
* Description: Program will prompt for some data, read in the values, perform
the calculation using library math functions, and display the result.
* File: lab5.c
*/

# define M_PI 3.14159265358979323846 /* pi */
# define M_E 2.7182818284590452354 /* e */
# define N_COEFF 2
# define CONST 1

int prompt_and_return_integer( const char *prompt );
double estimate_gospers_algorithm( const double n );
void display_results( const double answer );


int main ()
{
const char prompt_1;
double A,B ;
B = prompt_and_return_integer(&prompt_1);
A = estimate_gospers_algorithm(B);
display_results(A);
return EXIT_SUCCESS;

}

int prompt_and_return_integer( const char *prompt )
{

printf("Please enter a positive integer: ");
scanf("%lf", &*prompt);

return *prompt;

}


double estimate_gospers_algorithm( const double n )
{
double squrt_partial; // Gosper's formula under the square root, leaves out PI
double squrt_solved; // sqrt_part square rooted
double my_result; // powers multipled by the solved square root
double n_power;
double e_power;

squrt_partial = (N_COEFF * n) + CONST;
squrt_solved = sqrt(squrt_partial * M_PI);
n_power = pow(n,n);
e_power = pow(M_E,-n);

return n_power * e_power * squrt_solved;

}

void display_results( const double answer )
{
printf( " the factorial is %0.2f.\n", answer);

return;
}

my output is coming wrong can somebody help me to fix the problem?

In: Computer Science

Three identical light bulbs are connected to a 30V battery in a circuit. Bulb A is...

Three identical light bulbs are connected to a 30V battery in a circuit. Bulb A is on main loop and closest to battery. Bulbs B and C are in parallel and the junction is after Bulb A S1 is in the loop with bulb B and S2 is in loop with bulb C

Initially switch 1 is closed and switch 2 is opened. When switch 2 is closed what happens to the brightness of bulbs A,B and C Please explain

In: Physics

A door is closed under the control of a spring and dashpot. The spring gives a...

A door is closed under the control of a spring and dashpot. The spring gives a torque of 13.5 Nm when the door is closed and has a stiffness of 50 N.m/rad. The dashpot gives a damping torque of 100 N.m.s/rad. The moment of inertia of the door about its hinges is 90 Kg.m2. Derive an expression for the motion of the door if it is opened 90o and released and find approximately the time it takes to close

In: Mechanical Engineering

Q8. The post-closing trial balance of M/S. Shaheen Traders at 31 March 2020 is set out...

Q8.

The post-closing trial balance of M/S. Shaheen Traders at 31 March 2020 is set out below

:

Shaheen Traders

Post Closing Trial Balance

As on 31St March 2020

Particular

Debit

Credit

OMR

OMR

Cash at Bank

1,615

Sundry Debtors

17,761

Stock

24,219

Machinery

16,146

Equipment

42,787

Land & Building

32,292

Goodwill

16,146

Sundry Creditors

24,220

Bills Payable

4,844

Ajmal Capital

48,438

Azeem Capital

32,292

Kamran Capital

24,219

Profit and Loss Account

16,953

`

150,965  

150,965

On the above date, Ajmal retired, and the following arrangements were agreed upon:

  1. Goodwill of the firm is to be valued at OMR. 30,000.

  1. The assets and liabilities are to be valued as under: Stock OMR19,000, Sundry Debtors        OMR15,500, Land and Building OMR35,600, Equipment OMR38,000 and Machinery OMR       12,000 and Sundry Creditors OMR21,000.

  1. Azeem and Kamran were to introduce OMR23,000 and OMR8,000 respectively into the business and OMR18,200 was to be paid immediately and the balance transferred to his loan account.

  1. To bring into books unrecorded investments OMR 5,000

  1. Azeem and Kamran agreed not to retain goodwill in books.

  1. Ajmal, Azeem and Kamran profit and loss sharing ratio are 4 : 2 : 1 respectively.

You are required to pass necessary Journal entries with proper narrations to record the above transactions. Prepare revaluation account, capital accounts, bank account and financial position of the new firm as at 1st April 2020, after all above arrangement have been completed. Write down the impact of retirement with explanations cum values in the new balance sheet.  

In: Accounting

Q8. The post-closing trial balance of M/S. Shaheen Traders at 31 March 2020 is set out...

Q8.

The post-closing trial balance of M/S. Shaheen Traders at 31 March 2020 is set out below

:

Shaheen Traders

Post Closing Trial Balance

As on 31St March 2020

Particular

Debit

Credit

OMR

OMR

Cash at Bank

1,615

Sundry Debtors

17,761

Stock

24,219

Machinery

16,146

Equipment

42,787

Land & Building

32,292

Goodwill

16,146

Sundry Creditors

24,220

Bills Payable

4,844

Ajmal Capital

48,438

Azeem Capital

32,292

Kamran Capital

24,219

Profit and Loss Account

16,953

`

150,965  

150,965

On the above date, Ajmal retired, and the following arrangements were agreed upon:

  1. Goodwill of the firm is to be valued at OMR. 30,000.

  1. The assets and liabilities are to be valued as under: Stock OMR19,000, Sundry Debtors        OMR15,500, Land and Building OMR35,600, Equipment OMR38,000 and Machinery OMR       12,000 and Sundry Creditors OMR21,000.

  1. Azeem and Kamran were to introduce OMR23,000 and OMR8,000 respectively into the business and OMR18,200 was to be paid immediately and the balance transferred to his loan account.

  1. To bring into books unrecorded investments OMR 5,000

  1. Azeem and Kamran agreed not to retain goodwill in books.

  1. Ajmal, Azeem and Kamran profit and loss sharing ratio are 4 : 2 : 1 respectively.

You are required to pass necessary Journal entries with proper narrations to record the above transactions. Prepare revaluation account, capital accounts, bank account and financial position of the new firm as at 1st April 2020, after all above arrangement have been completed. Write down the impact of retirement with explanations cum values in the new balance sheet.  

In: Accounting

Before the audit report was signed, the audit team encountered the following situation. Treat each situation...

Before the audit report was signed, the audit team encountered the following situation. Treat each situation independently and assume the remaining financial statements are fine.

1) A property owned by Cook’s Furniture Ltd was sold to Lidia Preston, the wife of Howard Cook in June 2020. The property has a market value of four million and was sold at 3.2 million. Management did not disclose this in the financial statement because they believed this was a private matter. The disposal of this asset has been appropriately accounted for on the financial statements (e.g. the asset was removed from PPE and the loss of disposal was correctly recognised as an expense).

2) The subsequent selling price of the ready-made furniture range suggests the inventory valuation as at 30 June 2020 should be written down by $48,000 but management only wrote $38,000 off as per the financial statements because they were confident that they can increase the selling price again in 2021 after people settling back to normality.

3) Carl Cook decided to retire in 2021 due to health reasons, Carl is willing to sell his shareholding to the remaining shareholders. However, the BoD decided to explore the potential of selling the business. By the time to sign the 2020 financial statements, the company has not commenced a negotiation with any potential buyer. The BoD said to the auditor that they may not sell the business if they cannot get a good deal. Carl’s retirement decision is disclosed on the financial statements, but not the intention to sell the business.

REQUIRED: For each of the above situation:

a) Discuss the audit procedure that the auditor needs to perform in relation to each situation.

b) Explain which audit opinion is appropriate for each situation.

In: Accounting

What is a Bragg reflector? Which technology does needs this type of reflector and why?? What...

What is a Bragg reflector? Which technology does needs this type of reflector and why?? What is the primary advantage of this technology?

What is Immersion lithography? How can it improve the resolution? What one main issue with this technology?

In: Physics

Discuss three ways that technology has personally changed your life. Remember that technology is not limited...

Discuss three ways that technology has personally changed your life. Remember that technology is not limited to computers and cell phones. For example, the advancement in contact lens technology has changed lots of people's lives, right?

In: Psychology

Some students might not have assess to technology at home or at school. How might the...

Some students might not have assess to technology at home or at school. How might the problem of technology access be addressed for students? What can be done personally, to work towards providing equitable access to technology for students?

In: Psychology