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
Whitepunk [10]
3 years ago
15

The following program declares an array of char named as myString There are 6 following cases (a, b, c, d, e, f) to access myStr

ing. Which cases are valid access? If there are any invalid cases, how to correct them? #include using namespace std; int main() { char myString[16]; //a. strcpy_s(myString, "Hello the world"); //b. cout << strlen(myString); //c. myString = "Mary Lane"; //d. cin.getline(myString, 80); //e. cout << myString; //f. myString[6] = 't'; return 0;
Computers and Technology
1 answer:
yuradex [85]3 years ago
3 0

Answer:

See explaination

Explanation:

a.

myString is "Hello the world"

b.

prints "15"

c.

This is invalid.

We have to use strcpy_s to copy strings

FIX:

strcpy_s(s,"Marylane");

d.

reading string upto length 80 from the user and stored it in myString variable

e.

prints the string enetered by user to console

f.

replacing 7th character by 't'

You might be interested in
When viewing data entered into a spreadsheet, the columns identify _____.?
AlexFokin [52]
The answer is : variables
When viewing data entered into a spreadsheet, the columns identify Variable. The variables later can be used on a formula to help you process any sort of data that is implemented within excels' formula system
3 0
4 years ago
You created an interactive application named GreenvilleRevenue. The program prompts a user for the number of contestants entered
Korolek [52]

Answer:

Explanation:

The program in this code is written correctly and has the messages applied in the code. Therefore, the only thing that would need to be done is pass the correct integers in the code. If you pass the integer 100 contestants for last year and 300 for current year. Then these inputs will provide the following output as requested in the question.

The competition is more than twice as big this year!

This is because the current year would be greater than double last years (100 * 2 = 200)

4 0
3 years ago
Design the program that reads two files and compares their contents. The program calls a method that reads the file one line at
Advocard [28]

Answer:

file1 = []

file2 = []

fileone = "lyric1.txt"

filetwo = "lyric2.txt"

def linereader( myfile, mylist):

   for line in open(myfile, "r") as file:

       line_read = readlines( line)

       mylist.append( line_read)

   file.close()

linereader( fileone, file1)

linereader( filetwo, file2)

# Assuming both files have same number of lines.

for index, item in enumerate(zip(file1, file2)):

   if item[0] != item[1]:

       print( index + 1, item)

Explanation:

The python code compares two files and returns the number and the lines from both files that do not match. The source code opens the files lyric1.txt and lyric2.txt reading each lines to different lists which are iterated to compare its items returning the number of the line and the unequal lines.

5 0
3 years ago
How do productivity programs most benefit the way we work and live?
finlep [7]

Answer:

They provide us with ways to communicate, display, and work with information more quickly and accurately.

Explanation:

Productivity programs helps in the provision of information and they also help in increasing productivity by making work less stressful and unambiguous. Examples of productivity programs include design programs and spreadsheet tools.

These programs also create an avenue for providing us with ways to communicate, display and work with information more quickly and accurately.

6 0
4 years ago
What tag works as a dictionary between text &amp; computer bytes?
Lynna [10]

Answer:

Here is some python code

Explanation

5 0
3 years ago
Other questions:
  • What type of data visual would you use to illustrate trends over time? Gantt chart Bar graph Line chart Scatter diagrams
    5·1 answer
  • What is wrong with my code?
    7·1 answer
  • What conclusion did Freud reach when attempting to understand the connection between psychological and physical problems?
    12·1 answer
  • Once secured a wheelchair may move up to 6 inches in any direction
    6·1 answer
  • What is a feature of webmail
    13·1 answer
  • I have been charged for brainly plus yet I still have to watch ads why? What do I do?
    12·2 answers
  • Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have me
    10·1 answer
  • 4. Give four reasons why a laptop computer is more expensive than a desktop computer of the
    10·1 answer
  • Predict the output
    7·1 answer
  • How do I change my username/display name
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!