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
Murljashka [212]
3 years ago
7

Write a function that accepts an argument for a persons name. The method should loop through the number of characters in the nam

e sending each character to the screen each on a separate line.
#include

#include

using namespace std;

int main()

{

Plese fill in.....thanks
Computers and Technology
1 answer:
MatroZZZ [7]3 years ago
4 0

Answer:

#include <iostream>

#include<string.h>

using namespace std;

void printCharacter(string name){

   for(int i=0;name[i]!='\0';i++){

       cout<<name[i]<<endl;

   }

}

int main()

{

   string name;

   cout<<"enter the name: ";

   cin>>name;

   printCharacter(name);

}

Explanation:

first include the two libraries iostream for input/output and string library for using the string.

then, create the main function and declare the variable type string.

cout instruction is used o display the message on the screen.

cin is used to store the value in the name variable.

after that, call the function. The program control move to the the function. In the function for loop is used to print the character one by one until end of the name.

You might be interested in
Which statement will read an entire line of input into the following string object?
Solnce55 [7]

Answer:

getline(cin, address);

Explanation:

Given

String object: address

Required

Statement that reads the entire line

The list of given options shows that the programming language is c++.

Analysing each option (a) to (e):

a. cin<<address;

The above instruction will read the string object until the first blank space.

Take for instance:

The user supplied "Lagos state" as input, only "Lagos" will be saved in address using this option.

b. cin address:

This is an incorrect syntax

c. getline(cin,address);

Using the same instance as (a) above, this reads the complete line and "Lagos state" will be saved in variable address

d. cin.get(address);

address is created as a string object and the above instruction will only work for character pointers (i.e. char*)

<em>From the above analysis, option (c) is correct.</em>

6 0
2 years ago
What is a privacy data breach
kotykmax [81]

Answer: A privacy data breach occurs when personal information is stolen or lost or is collected, used or disclosed without authority. A privacy breach occurs when personal information is stolen or lost or is collected, used or disclosed without authority.

Explanation:

Examples of a  data breach might include:

Loss or theft of hard copy notes, USB drives, computers or mobile devices. an unauthorized person gaining access to your laptop, email account or computer network. sending an email with personal data to the wrong person.

7 0
1 year ago
An international package shipping company like FedEx needs to be able to track the location of every package at every stage in t
Luba_88 [7]

Answer:

<em>The specific type of software useful in this situation would be a ship manager software. </em>

Explanation:

<em>It is a stand alone, user installable, windows-based software package designed to allow the quickly ship, track, and report the daily activities.</em>

<em>In addition to managing shipment information, the software keeps the details of the operation, so that the user can easily retrieve necessary information about his shipments.</em>

8 0
3 years ago
Read 2 more answers
Accept total number of participants (B) in class. A group of
mestny [16]

The <em>required code</em> written in python 3 which assigns participants to the <em>4 groups</em> based on the instruction given goes thus :

def assign(p):

<em>#initialize a function named assign </em><em>which</em><em> </em><em>takes</em><em> </em><em>in</em><em> </em><em>one</em><em> </em><em>argument</em><em> </em><em>which is</em><em> </em><em>the</em><em> </em><em>number</em><em> </em><em>of</em><em> </em><em>participants</em><em> </em>

if p%2 == 0 :

<em>#checks</em><em> </em><em>if</em><em> </em><em>the</em><em> </em><em>number</em><em> </em><em>of</em><em> </em><em>participants</em><em> </em><em>is</em><em> </em><em>even</em><em> </em>

val = p/4

<em>#divide</em><em> </em><em>the</em><em> </em><em>number</em><em> </em><em>into</em><em> </em><em>4</em><em> </em><em>equal</em><em> </em><em>groups</em><em> </em>

a,b,c,d = (val,val,val,val)

<em>#assign</em><em> </em><em>the</em><em> </em><em>equal</em><em> </em><em>value</em><em> </em><em>to the</em><em> </em><em>group</em><em> </em><em>’</em><em>s</em><em> </em><em>using</em><em> </em><em>tuple</em><em> </em><em>unpacking</em><em> </em>

print('Group A = %d, Group B = %d, Group C = %d, Group D = %d' %(a,b,c,d))

<em>#display</em><em> </em><em>the</em><em> </em><em>grouping</em><em> </em>

else :

<em>#if</em><em> </em><em>it</em><em> </em><em>is</em><em> </em><em>not</em><em> </em><em>even</em><em>,</em><em> </em><em>then</em><em> </em>

val = p//4

<em>#get</em><em> </em><em>the</em><em> </em><em>whole</em><em> </em><em>number</em><em> </em><em>divison</em><em> </em><em>into</em><em> </em><em>4</em><em> </em><em>groups</em><em> </em>

rem = p%4

<em>#get</em><em> </em><em>the</em><em> </em><em>remainder</em><em> </em><em>value</em><em> </em>

a,b,c,d = (val, val, val , val+rem)

<em>#assign</em><em> </em><em>the</em><em> </em><em>whole</em><em> </em><em>number</em><em> </em><em>to</em><em> </em><em>the</em><em> </em><em>first</em><em> </em><em>three</em><em> </em><em>groups</em><em> </em><em>and</em><em> </em><em>the</em><em> </em><em>sum</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>whole</em><em> </em><em>number</em><em> </em><em>and</em><em> </em><em>remainder</em><em> </em><em>to</em><em> </em><em>the</em><em> </em><em>fourth</em><em> </em><em>group</em><em> </em>

print('Group A = %d, Group B = %d, Group C = %d, Group D = %d' %(a,b,c,d))

<em>#display</em><em> </em><em>the</em><em> </em><em>allocation</em><em> </em><em>of</em><em> </em><em>participants</em><em> </em>

Therefore, the sample run of the program is attached below.

Learn more :brainly.com/question/24895955

6 0
2 years ago
Software which allows user to view the webpage is called as____
melisa1 [442]
“1. Website” is correct.
5 0
3 years ago
Other questions:
  • Write a function removeEvens to remove all the even numbers from input row array inRowArray which contains integer numbers. The
    15·1 answer
  • The technical relationship between inputs and outputs, which is needed to understand the difference between the short run and th
    5·1 answer
  • why might a portrait be both a portrait of the subject and the photographer? how is a photographer present in a portrait?
    10·2 answers
  • Can someone explain to me how to do circuit calculations
    11·1 answer
  • PLEASE HELP I WILL GIVE YOU BRAINLILY
    15·2 answers
  • Create the logic for a program that prompts a user for 12 numbers and stores them in an array. Pass the array to a method that r
    8·1 answer
  • What usually happens during the investigation &amp; analysis stage of the Systems Life Cycle
    15·1 answer
  • Which of the following is a key aspect of any IT position? installation of fiber optic cables
    14·2 answers
  • What problems do you see in the process of transacting business online
    10·1 answer
  • What are the three algorithm constructs?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!