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

9.4 Code Practice:Question 1

Computers and Technology
1 answer:
Ymorist [56]3 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
How was wifi made? bro
Helen [10]

Answer: "Once a Transmitter receives data from the internet, it converts the data into a radio signal that can be received and read by WIFI-enabled devices. When was WIFI invented? Wifi was invented and first released for consumers in 1997 when a committee called 802.11 was created."

(Non Of This Information Is Mine I Have No Rights Or Ownership Not For Plagiarism Purposes Information Based Only 2022.)

Explanation: ...

3 0
2 years ago
Read 2 more answers
If a hacker can steal your passwords by installing malware that captures all the messages you type, what kind of malware did the
Free_Kalibri [48]
Keylogger, or Spyware
4 0
3 years ago
Read 2 more answers
Data is removed at the back of the queue.a) trueb) false
alexdok [17]

Answer:

true

Explanation:

4 0
3 years ago
What would be a situation in which you could use an Excel chart to present your data?
Minchanka [31]
The second one is correct
5 0
3 years ago
Read 2 more answers
An example for Shareware?
Kryger [21]
A software that is free of cost for a certain amount of time such as Adobe programs, or Winzip.
6 0
2 years ago
Read 2 more answers
Other questions:
  • 2. Fabulously Fit offers memberships for
    9·1 answer
  • If you are writing an article on your favorite cuisine, which form of illustration would best fit the article?
    15·2 answers
  • How can I identify what is and what isn't an IP Address?
    5·1 answer
  • What is one step taken when solving a computer software problem?
    6·2 answers
  • Which tab on the Chart Tools Contextual tab will contain commands that are used to change the style of charts and to edit chart
    12·2 answers
  • How to deactivate the brainly account?​
    13·1 answer
  • Karen works in a department store. Her coworker gave diverse cultural backgrounds. Which statement shows that Karen understand t
    14·1 answer
  • A CPU has just been powered on and it immediately executes a machine code instruction. What is the most likely type of instructi
    13·1 answer
  • A continuous and differentiable function f(x) with the following properties: f(x) is decreasing at x=−5 f(x) has a local minimum
    13·1 answer
  • Q.3.1 Explain why devices on a network need addresses. (5)​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!