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
blondinia [14]
4 years ago
6

9.4 Code Practice:Question 1

Computers and Technology
1 answer:
Ymorist [56]4 years ago
4 0

Answer:

// Program is written in C++

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

using namespace std;

int main()

{

// Declare array

/* There are 18 characters between f and w. So, the array is declared as thus;*/

char letters [18];

// Initialise array index to 0

int i = 0;

// Get input

for(char alphs = 'f'; alphs<='w'; alphs++)

{

letters[i] = alphs;

// Increment array elements

i++;

}

// Print Array

cout<<"['";

for(int j = 0; j <18; j++)

{

if(j<17){

cout<<letters[j]<<"', '";

}

else

{

cout<<letters[j]<<"']";

}

}

return 0;

}

Explanation:

The above code declares a char array named letters of length 18. This is so because there are 18 characters from f to w (both inclusive). This is done using the following: char letters [18];

Index of array starts from 0; so, the next line initializes the array letters to 0 and prepares it for input.

The first for-loop statement is used to input characters to letter array. This done by iterating from 'f' to 'w' using variable alphs.

Outside the for loop; the statement cout<<"['"; prints ['

The next for loop prints f','g','h' ........ 'w']

Bring this two prints together, it gives the desired output

['f','g','h' ........ 'w']

You might be interested in
Give a recursive algorithm to compute the sum of the cubes of the first n positive integers. The input to the algorithm is a pos
DaniilM [7]

Answer:

def sum_cubes(n):

   if n == 1:

       return 1

   else:

       return n * n * n + sum_cubes(n-1)

print(sum_cubes(3))

Explanation:

Create a function called sum_cubes that takes one parameter, n

If n is equal to 1, return 1. Otherwise, calculate the cube of n, and add it to the sum_cubes function with parameter n-1

If we want to calculate the cubes of the first 3 numbers:

sum_cubes(3) = 3*3*3 + sum_cubes(2)

sum_cubes(2) = 2*2*2 + sum_cubes(1)

sum_cubes(1) = 1

If you substitute the values from the bottom, you get 27+8+1 = 36

7 0
3 years ago
Drag the tiles to the correct boxes to complete the pairs.
-BARSIC- [3]

1) ECPA is D. Prohibits the government and law enforcement agencies from acquiring information about an individual through telephonic or digital media.

2) COPPA is C. Restricts websites from acquiring information from users below the age of thirteen.

3) OPPA is A. Directs company websites to declare their privacy policies and their expiration dates on their websites if the users are from California.

4) FCRA is B. Regulates credit ratings and how agencies view an individual's credit information.

8 0
3 years ago
Read 2 more answers
Typically, when an organization purchases Internet access from an Internet Service Provider (ISP), the ISP will grant it
Radda [10]

Answer:

(B) A single public IP address that it can use for NAT

Explanation:

Because the IPV4 IP protocol is still used today, the number of available IP addresses is limited (only 4,294,967,296 addresses in the world), for this reason, the most correct practice is the assignment of a single public IP to those companies that acquire services from an ISP, with some few exceptional cases of companies that own several.

So that the company's addressing can be executed successfully, the use of NATs is enabled, this allows the translation of network addresses, allowing the company to have as many private networks as necessary and that these can be communicated Correctly with the global network, the Internet, through the public IP of the company.

4 0
4 years ago
An anchor tag can be coded using which two attributes?
IceJOKER [234]

Answer:

21212122121221212211212121212212121Explanation:

4 0
2 years ago
A(n) _____ is any hardware component that allows you to enter data and instructions into a computer or mobile device.
Darya [45]
Hello there.

<span>A(n) _____ is any hardware component that allows you to enter data and instructions into a computer or mobile device.

</span><span>Input Device</span>
4 0
4 years ago
Other questions:
  • When composing a tweet with images attached in hootsuite, bear in mind that _____ characters are used up by the photos?
    9·1 answer
  • PLEASE HELP
    12·2 answers
  • Assume that an array named a containing exactly 5 integers has been declared and initialized. Write a single statement that adds
    6·1 answer
  • Hey I don’t have a question I’m just testing something on this app
    6·2 answers
  • Please help! i need to answer this soon!
    13·1 answer
  • You can change the size of text using which block of code?
    11·1 answer
  • Three common risk factors for young drivers and how you plan to minimize these factors.
    13·1 answer
  • When does the following while-loop stop running?
    10·1 answer
  • What does error code 18 indicate?
    11·1 answer
  • Write a Python statement that displays the value referenced by the number variable formatted as1,234,567.5
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!