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
DaniilM [7]
3 years ago
6

Write a function called countstuff () that takes as a parameter a character array, and returns an int. The prototype must be:

Computers and Technology
1 answer:
PSYCHO15rus [73]3 years ago
5 0

Answer:

Please kindly go to the explanation part.

Explanation:

The required function is written in Raw code below.

Function:

#include<stdio.h>

#include<ctype.h> //including required libraries

int countstuff(char s[]){ //Function countstuff

int cntUp=0,cntLow =0,cntDigits = 0,i=0,value; //declaring required variables

for(i=0;s[i]!='\0';i++){ //loop to iterate over the characters of string

if(isupper(s[i])){

cntUp++; //incrementing count of uppercase if it is uppercase character

}

else if(islower(s[i])){

cntLow++; //incrementing count of lowercase if it is lowercase character

}

else if(isdigit(s[i])){

cntDigits++; //incrementing count of digits if it is digit

}

}

value = cntUp*1000000 + cntLow*1000 + cntDigits; //counting value using formula given in question

return value; //returning the value

}

void main(){

char string[1000]; //declaring required variables

int value;

printf("Enter a String:");

scanf("%[^\n]s",string); //taking string as input

value = countstuff(string); //calling function

printf("The Value is : %d\n",value); //printing result

}

You might be interested in
Select all that apply.
Ierofanga [76]
Insert option the last one
3 0
3 years ago
Read 2 more answers
Brad Jones is in the process of opening an electronics supply company and is working on the portion of his business plan templat
zlopas [31]

Answer:

b. channels

Explanation:

When it comes the distribution of a product we always use <em>channels of distribution </em>in Business Terminology. Therefore, <em>b. channels</em> is the correct option.

5 0
4 years ago
-Write a function is_perfect, which accepts a single integer as input. If the input is not positive, the function should return
Genrish500 [490]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// function

string is_perfect(int n)

{

   // string variables

   string str;

   // if number is negative

   if (n < 0)

   {

        str="invalid input.";

   }

   // if number is positive

   else

   {

      int a=sqrt(n);

      // if number is perfect square

      if((a*a)==n)

      {

          str="True";

      }

      // if number is not perfect square

      else

      {

          str="False";

      }

   }

   // return the string

     return str;

}

// main function

int main()

{

   // variables

int n;

cout<<"enter the number:";

// read the value of n

cin>>n;

// call the function

string value=is_perfect(n);

// print the result

cout<<value<<endl;

return 0;

}

Explanation:

Read a number from user and assign it to variable "n".Then call the function is_perfect() with parameter n.First check whether number is negative or not. If number is negative then return a string "invalid input".If number is positive and perfect square then return a string "True" else return a string "False".

Output:

enter the number:-3

invalid input.

enter the number:5

False

enter the number:16

True

4 0
3 years ago
A business would use a website analytics tool for all of the following EXCEPT _____.
BaLLatris [955]

Answer:

C. viewing why someone visited your webpage

Explanation:

Website analysis often referred to as Web analytics is a term that is used to describe a form of website distribution, activity, and proportion relating to its performance and functionality.

Some of the things Web analytics does include the following:

1.  measures the number of pages a user or visitor viewed or assessed

2.  counts the number of new and returning visitors

3.  helps website administrator to know when to increase bandwidth

Hence, in this case, the correct answer is option C. viewing why someone visited your webpage

4 0
3 years ago
Pls help. will give brainliest to FIRST and CORRECT answer!
Zolol [24]

Answer:

All of the above

Explanation:

7 0
3 years ago
Other questions:
  • Where is the typical location of a touchpad inside of a laptop?
    14·1 answer
  • In evaluating a loop, you find the following statement:
    11·1 answer
  • In terms of computer networking. what is PING?
    5·1 answer
  • What is the system of phonographic disc recordings paired with a projector called?
    9·1 answer
  • Consider two different implementations of the same instruction set architecture (ISA). The instructions can be divided into four
    14·1 answer
  • Suppose testcircle1 and circle1 in listing 9.1 are in two separate files named testcircle1.java and circle1.java, respectively.
    14·1 answer
  • Need help please help me <br>I need it right now ​
    15·1 answer
  • PLZ HELP ME!!
    8·2 answers
  • Create a script to input 2 numbers from the user. The script will then ask the user to perform a numerical calculation of additi
    7·1 answer
  • Complete two examples of how scientists, technologists, engineers, and mathematicians may work together to create a new product
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!