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
Create a Double complementary or tetradic colors (are a set of two complementary pairs of colors that form a rectangle on the co
hjlf

Answer:

(Remember, two colors are complementary if they are opposite each other ... colors are connected on the color wheel they form a rectangle.

Explanation:

best one i could find if worng am verys very sorry.

4 0
3 years ago
Read 2 more answers
Which of the following is not a characteristic of a good value log entry
Stolb23 [73]
What are we supposed to find? Help us
6 0
2 years ago
How to recover permanently deleted photos on iphone 11?
grandymaker [24]

Answer:

Look in your recently deleted album and if it is not there try checking your iCloud, if its not there then it's sadly probably gone forever.

Explanation:

7 0
2 years ago
Which of the following is a Reach Key on your keyboard?
zhannawk [14.2K]

Answer:J key

Explanation:I want my brainlyiest pls

6 0
2 years ago
This type of program is designed to be transmitted over the internet and run in a web browser
vodomira [7]
This sounds like a web-based application because they are designed to be ran within a website, generally with Adobe Flash.
8 0
3 years ago
Other questions:
  • A laptop gets replaced if there's a hardware issue. Which stage of the hardware lifecycle does this scenario belong to?
    5·1 answer
  • Which of the following would likely be covered under homeowners insurance but NOT by renter's insurance?
    9·2 answers
  • What needs to be increased in order to increase image size and clarity?
    10·1 answer
  • Two samples of dirt are collected from a suspect's tread in his shoe and a crime scene. The forensic investigator does a gross e
    6·2 answers
  • Which of the following can be used to get an integer value from the keyboard?
    12·1 answer
  • What is said to be the first mechanical calculator​
    7·2 answers
  • Magbigay ng tatlong hanap buhay na makukuha sa mineral produktong galing sa dagat at produktong agrikultural
    10·2 answers
  • Carlos had 194 seeds and 11 flower pots he put the same number of seeds in each flower pot which is the best estimate for the nu
    6·1 answer
  • _________ is the most popular high-level Java API in Hadoop Ecosystem. Cascading Scalding Cascalog None of the options
    7·1 answer
  • Which term means a cryptography mechanism that hides secret communications within various forms of data?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!