subject
Computers and Technology, 05.05.2020 19:29 npatony

Write a function called countstuff () that takes as a parameter a character array, and returns an int. The prototype must be:
int countstuff (char s[]);
The array passed will be less than 1000 characters long. Your code should return a value indicating the number of uppercase characters, the number of lowercase characters, and the number of digits in the string. The number of uppercase characters should be returned in the millions places, the number of lowercase in the thousands places, and the number of digits in the units places (i. e. UUULLLDDD).

x=countstuff ("Space the final FRONTIER"); // x= 9012000
x=countstuff ("THERE ARE 4 LIGHTS"); // x=14000001
x=countstuff ("Send $1000 to Your Favorite ChArItY!!!"); // x=13012004

To force values into the millions, thousands, or units places, you can do something like
V = cntUp*1000000 + cntlow* 1000 + cntDigits

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:20, babyrocks7300
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
image
Computers and Technology, 22.06.2019 20:10, yqui8767
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
image
Computers and Technology, 23.06.2019 19:40, Latoyajenjins1789
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system. currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system. currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system. currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
image
Computers and Technology, 24.06.2019 02:10, sIatt
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
You know the right answer?
Write a function called countstuff () that takes as a parameter a character array, and returns an in...

Questions in other subjects:

Konu
English, 26.12.2019 19:31