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
neonofarm [45]
3 years ago
14

We have an N x N square grid.

Computers and Technology
1 answer:
max2010maxim [7]3 years ago
5 0

Answer:

The solution in C++ is:

#include <iostream>

using namespace std;

int main(){

   int N, A;

   cout<<"Grids: ";    cin>>N;

   cout<<"White: ";    cin>>A;

   cout<<"Black: "<<N * N - A;

   return 0;

}

Explanation:

This declares N and A, as integers

   int N, A;

This gets inputs for N

   cout<<"Grids: ";    cin>>N;

This gets inputs for A, (the white grids)

   cout<<"White: ";    cin>>A;

This calculates and prints the number of black grids

   cout<<"Black: "<<N * N - A;

<u>PS</u>

From the question, we understand that the grid is N by N square grids.

This means that:

Total = N * N

So, the number of black grids is:

Black =  Total - A

You might be interested in
If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
Nadusha1986 [10]

Answer:

hacker can steal your data in many ways.

Explanation:

if you allow cookie site for fake websites. It can absolutely be possible.

5 0
4 years ago
Fill in the blacks
Taya2010 [7]
What are the choices to choose from
8 0
3 years ago
Is phone data used when connected to wifi
finlep [7]
I do not think so, no.
7 0
4 years ago
Calculator is an example of
Shalnov [3]

D. digital

Explanation:

I hope it helps you

7 0
3 years ago
Which of the following methods is a static method? The class in which the method is defined is given in parentheses following th
maw [93]

Answer:

C. sqrt(Math)

Explanation:

All but one of options A to E are is not a static method.

Only option C is a static method. The sqrt() is a static method of Math, that can always be used as Math.sqrt() is used;

The Math class defines all of its methods to be static. Invoking Math methods is done by using Math as a method rather than a variable of type Math; this means that sqrt(Math) doesn't rely on instance variables and don't need to be overridden, unlike others.

Lastly, sqrt(Math) is a static method because unlike other options, it is an utility method, and it is relevant to computations on primitive data types.

The purpose of the static method is in large part to offer a standard library of functions, and it doesn't need to be applied directly to an object.

4 0
3 years ago
Other questions:
  • Melinda completed the Computer Programming Aptitude Test when she applied for a position with Beta Electronics. Six months later
    12·1 answer
  • The critical path in a project network is:______ A. The Shortest path through the network. B. Longest path through the network.
    8·1 answer
  • If you see an icon in a document preset that looks like a tiny web browser window, what type of document is the preset meant to
    13·1 answer
  • A computer system has 9,850 processes and 172 of them were suspended while 276 of them were terminated. Explain why some of the
    12·1 answer
  • Janis is preparing a financial document. She needs to use the dollar symbol placed above the number key 4. Which key will Janis
    14·1 answer
  • A microphone plugs into what type of connector
    5·2 answers
  • (6 pts) Write a bash shell script called 08-numMajors that will do the following: i. Read data from a class enrollment file that
    10·1 answer
  • What was the first video game ever invented
    11·2 answers
  • WILL GIVE BRAINLEST!!!!!!!! 10 POINTS!!!!
    5·2 answers
  • Write a programmer defined function that compares the ASCII sum of two strings. To compute the ASCII sum, you need to compute th
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!