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
A new employee has reported that print jobs are printing as garbled text. Which of the following is MOST likely the reason for t
e-lub [12.9K]

Answer:

Option (C) is the correct option.

Explanation:

When the printer printing the documents in a distorted way then, the following workstation installed the wrong drivers for the printer. The computer operator or the technician installs the right driver in the computer system or the workstation. That's why the following issues are generating at the time of printing the documents.

4 0
3 years ago
Joshua takes ownership of all his tasks. Which quality is he demonstrating?
Oxana [17]
Were these the choices?
A. Honesty B. Responsibility C. Approachability D. Confidence E. Resourcefulness 

If so, it would be Letter B - responsibility. He's taking responsibility for the tasks. He's taking the initiative to do the tasks rather than waiting passively for someone to do it.
8 0
3 years ago
Read 2 more answers
Give a real life of an if statement
bogdanovich [222]

Answer:

If Joe wants to eat an apple then he eats an apple.

Explanation:

The if statement checks if Joe "wants to eat an apple", if it turns out he does not then nothing will happen.

7 0
3 years ago
Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
pentagon [3]

Answer:

application software?

Explanation:

7 0
3 years ago
Which device on a network performs network address translation?
Alika [10]
Network Address Translation<span> (NAT) is the answer</span>
4 0
3 years ago
Other questions:
  • What is the name of the program that takes high-level code and transforms it into machine-level code?
    8·1 answer
  • You've formatted the first paragraph of a document. What button can you use to apply the formatting from the first paragraph to
    9·2 answers
  • If you print a document with red green or blue underlines will they show up on printed pages
    14·1 answer
  • Was the type writer the first part of the keyboard? ​
    8·1 answer
  • One common method of converting symbols into binary digits for computer processing is called ASCII​ (American Standard Code of I
    5·1 answer
  • Click on the _____ tab on the ribbon to open the backstage view.
    7·1 answer
  • Columns are labeled with letters and Rows are labeled with numbers.
    5·1 answer
  • . Two blue armies are each poised on opposite hills preparing to attack a single red army in the valley. The red army can defeat
    5·1 answer
  • We can sort a given set of n numbers by first building a binary search tree containing these numbers (using Tree-Insert repeated
    12·1 answer
  • What are the value and data type (float, int, bool, or str) of this expression:<br> 5 // 2
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!