1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
suter [353]
3 years ago
11

Create a function, return type: char parameters: int *, int * Inside the function, ask for two integers. Set the user responses

to the int * parameters. Prompt the user for a character. Get their response as a single character and return that from the function. In main Define three variables and call your function. Print values of your variables
Computers and Technology
1 answer:
iris [78.8K]3 years ago
4 0

Answer and Explanation:

In C programming language:

char fun(int*a, int*b){

printf("enter two integers: ");

scanf("%d%d",a,b);

int e;

printf("please enter a character: ");

e=getchar();

return e;

}

int main(int argc, char *argv[]) {

int d;

int f;

int g;

fun();

printf("%d%d%d", d, f, g);

}

We have declared a function fun type char above and called it in main. Note how he use the getchar function in c which reads the next available character(after the user inputs with printf()) and returns it as an integer. We then return the variable e holding the integer value as char fun() return value.

You might be interested in
Given an array temps of double s, containing temperature data, compute the average temperature. Store the average in a variable
Ket [755]

Answer:

#include <iostream>

using namespace std;

// average function

void average(double arr[], int n) {

double total = 0;

double avgTemp;

for (int i = 0; i < n; i++)

{

 // find temperatures total

 total = total + arr[i];

}

// find average

avgTemp = total / n;

cout << "\nAverage Temperature = " << avgTemp << endl;

}

// print temps[] array

void printArray(double arr[], int n) {

for (int i = 0; i < n; i++)

{

 cout << arr[i] << "   ";

}

}

int main() {

int const k = 5;

double temps[k];

// temperature value

double tempValue;  

// Enter 5 temperatures of your choice

for (int i = 0; i < k; i++)

{

 cout << "Enter Temperature value " << i+1 << ": ";

 cin >> tempValue;

 temps[i] = tempValue;

}

// Function call to print temps[] array

printArray(temps, k);  

// Function call to print average of given teperatures

average(temps, k);        

return 0;

}

Explanation:

• Inside main(), int constant k is created to set the maximum size of array temps[].

• tempValue of  type double takes value at a given index of our temps[] array.

• the for loop inside main() is used to get tempValue from the user and store those values in our array temps[].

• after that printArray() function is called. to pass an array to a function it requires to perimeters 1) name of the array which is temps in our case. 2) maximum number of the index which is  k.

• note the syntax of void average(double arr[], int n). Since we are passing an array to the function so its formal parameters would be arr[] and an int n which specifies the maximum size of our array temps[].

6 0
3 years ago
The java compiler is able to find all programmer errors.
Troyanec [42]
No compiler can do that. Maybe with AI, but that's beyond the scope of a compiler.
5 0
3 years ago
What are the six things you will learn this week on Scratch?
notka56 [123]

Answer:

1 You can learn to draw

2 You can learn to code

3 You can learn to make a thumbnail

4 You can learn how to follow yourself

5 You can learn  to remix your own projects

6 You can learn how to make a featured project you've never shared

Explanation:

8 0
2 years ago
The data below represents the yearly earnings (in $1000s of dollars) that high school and college (BS) graduates earn at a small
Taya2010 [7]

Answer:

library(moments)

library(readxl)

Exam1Q1 <- read_excel("Exam1Q1.xlsx")

View(Exam1Q1)

## Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE):

## running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/

## Resources/modules/R_de.so'' had status 1

plot(density(Exam1Q1$Highschool))

gostino.test(Exam1Q1$Highschool)

##  

##  D'Agostino skewness test

##  

## data:  Exam1Q1$Highschool

## skew = -0.24041, z = -0.69269, p-value = 0.4885

## alternative hypothesis: data have a skewness

agostino.test(Exam1Q1$BS)

##  

##  D'Agostino skewness test

##  

## data:  Exam1Q1$BS

## skew = 0.53467, z = 1.49330, p-value = 0.1354

## alternative hypothesis: data have a skewness

anscombe.test(Exam1Q1$Highschool)

##  

##  Anscombe-Glynn kurtosis test

##  

## data:  Exam1Q1$Highschool

## kurt = 2.56950, z = -0.29677, p-value = 0.7666

## alternative hypothesis: kurtosis is not equal to 3

anscombe.test(Exam1Q1$BS)

##  

##  Anscombe-Glynn kurtosis test

##  

## data:  Exam1Q1$BS

## kurt = 3.6449, z = 1.2599, p-value = 0.2077

## alternative hypothesis: kurtosis is not equal to 3

t.test(Exam1Q1$Highschool,Exam1Q1$BS, var.equal = T)

##  

##  Two Sample t-test

##  

## data:  Exam1Q1$Highschool and Exam1Q1$BS

## t = 0.16929, df = 76, p-value = 0.866

## alternative hypothesis: true difference in means is not equal to 0

## 95 percent confidence interval:

##  -1.131669  1.341926

## sample estimates:

## mean of x mean of y  

##  39.51282  39.40769

Explanation:

Summary:

The data set include two dependent variables which states High School annual earnings and BS annual earnings in the same small firm. Firstly, I used density plot function to view the distribution of two sets of variables. Secondly, I tested the skewness and kurtosis.Skewness of High School is -0.24041 which is left tail. Skewness of BS is 0.53476 which is right tail.Kurtosis of High School is 2.5695 which lower than 3 is platykurtic. Kurtosis of BS is 3.6449 which larger than 3 is leptokurtic. Thirdly, the sample population is 39 for each and has unknow standard deviation, so that I’m going to use t-test to perform the comparing analysis. The result shows p-value which equal to 0.866 is larger than significant value(alpha = 0.05). To the concludsion, there is no difference between yearly earnings of High School and of BS at a small firm.

3 0
3 years ago
The Adaptive Software Development (ASD) life cycle model assumes that software development follows an adaptive approach because
allsm [11]

Answer: ....

false

Explanation:

Adaptive Software Development (ASD) is a direct outgrowth of an earlier agile framework, Rapid Application Development (RAD). It aims to enable teams to quickly and effectively adapt to changing requirements or market needs by evolving their products with lightweight planning and continuous learning.

The Adaptive Software Development (ASD) life cycle model assumes that software development follows an adaptive approach because the requirements cannot be clearly expressed early in the life cycle. it refers to a problem-solving approach that requires defining the scope of a system, dividing it into its components, and then identifying and evaluating its problems, opportunities, constraints, and needs.

7 0
2 years ago
Other questions:
  • Individuals with desirable traits will be __________ to have young that survive than individuals without these traits. (2 points
    5·2 answers
  • Many works by Mark Twain were published before 1923. In addition, there are other works that were discovered after his death and
    8·1 answer
  • Write a basic program that performs simple file and mathematical operations.
    6·1 answer
  • Why computer is known as data processing system?
    14·1 answer
  • For the description below, develop an E-R diagram:
    9·1 answer
  • Fred wants to analyze his spending habits of the past few years and has gathered information on the checks he has written from 2
    6·1 answer
  • Early photographers take to work with what in order to produce photographs? (Btw this is photography, it just isn't a subject in
    9·1 answer
  • Hardware refers to programs and protocols used on a computer system.<br><br> True<br> False
    8·2 answers
  • , , ,g d,t ,dt m,dt ymtd
    9·1 answer
  • In python, sorry if it’s blurry
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!