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
Kamila [148]
3 years ago
5

I am trying to write a c++ program like the game typeracer. When the player starts the program he will be asked to write a sente

nce. I want to divide this sentence into characters so that every time the player hits a key on his keyboard the code will see if he has entered the correct character. Please help! :)
Computers and Technology
1 answer:
murzikaleks [220]3 years ago
6 0
Http://www.cprogramming.com/tutorial/string.html

--------------------------------------------------------------------
You might be interested in
12. Write C statement(s) that accomplish the following. a. Declare int variables x and y. Initialize x to 25 and y to 18. b. Dec
saul85 [17]

Answer:

a.

int x = 25;

int y = 18;

b.

int temp = 10;

char ch ='a';

c.

x += 5;

d.

double payRate = 12.5;

e.

int tempNum = firstNum;

f.

int tempp = x;

x = y;

y = tempp;

g.

printf("Value of x = %f\n",x);

printf("Value of y = %f\n",y);

printf("Arithmetic = %f\n",(x + 12/y -18));

h.

char grade = 'A';

i.

int a,b,c,d;

a = 5; b = 2; c = 3; d = 6;

j.

int x = round(z);

Explanation:

The answers are straight forward.

However, I'll give a general hint in answering questions like this.

In C, variable declaration is done by:

data-type variable-name;

To declare and initialise the variable, you do;

data-type variable-name = value;

So, for questions that requires that we declare and initialise a variable, we make use of the above syntax..

Take (a) for instance:

int x = 25;

int y = 18;

Same syntax can be applied to (b), (d), (e), (h) & (I)

For question (c);

This can be done in two ways;

x = x + 5;

Or

x+=5;

Both will give the same result.

For question (f):

We start by initialise a temporary variable that stores x.

Then we store the value of x in y.

Then we store the content of the temporary variable to y.

This swaps the values of x and y

For question (g):

When printing a double variable in C, we make use of '\f' as a string format

For question (j):

The round function is used to round up a double variable to integer.

3 0
3 years ago
Sam's take-home pay is $743. His deductions are $25 for OASDI, $5 for Medicare, and $27 for income tax. What is his gross pay? A
Katarina [22]

<u>Answer:</u>

A. $686.00

<u>Reasoning:</u>

25+5+27=57 So the total amount of the deductions is $57

Subtract 57 from 743

743 - 57 = 686

So he is left with 686

5 0
3 years ago
How to do 2. Pleaser
V125BC [204]

Answer:

GOD HAS FORSAKEN YOU NOW PRAISE DHAR MANN

6 0
3 years ago
Which of the following does NOT describe a node?
erica [24]

Answer:

hi sis i love you

Explanation:

6 0
3 years ago
Read 2 more answers
Write a java program to read elements in an array from user and count total number of duplicate elements in array.
Anna11 [10]

Answer:

Explanation:

The following code is written in Java and is a function/method that takes in an int array as a parameter. The type of array can be changed. The function then creates a counter and loops through each element in the array comparing each one, whenever one element is found to be a duplicate it increases the counter by 1 and moves on to the next element in the array. Finally, it prints out the number of duplicates.

public static int countDuplicate (int[] arr) {

               int count = 0;

               for(int i = 0; i < arr.length; i++) {

                       for(int j = i + 1; j < arr.length; j++) {

                               if(arr[i] == arr[j])

                                       count++;

                       }

               }

               return count;

       }

8 0
3 years ago
Other questions:
  • Can someone please help me in answering this!?! <br> The language is C++
    9·1 answer
  • Write a program that finds the largest in a series of numbers entered by the user.The program must prompt the user to enter numb
    12·1 answer
  • What is not true of credit scores?
    11·1 answer
  • The ________ view in access looks similar to an excel spreadsheet.
    5·1 answer
  • Consider the following code segment.
    11·1 answer
  • What is syntax?
    15·1 answer
  • Write a program that prompts the user to enter an oligonucleotide sequence, such as TATGAGCCCGTA.
    7·1 answer
  • Write a program with a function that accepts a string as an argument and returns the number of uppercase, lowercase, vowel, cons
    14·1 answer
  • Using filtering as a strategy to deal with information overload requires Group of answer choices reviewing all unsolicited infor
    14·1 answer
  • Alex has composed a layout with this Image for a magazine. Which rule of composition has Alex applied?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!