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
xeze [42]
3 years ago
15

Write the definition of a function dashedline, with one parameter , an int . if the parameter is negative or zero, the function

does nothing. otherwise it prints a complete line terminated by a new line character to standard output consisting of dashes (hyphens with the parameter 's value determining the number of dashes. the function returns nothing.
Computers and Technology
1 answer:
GalinKa [24]3 years ago
5 0
Static void DashedLine(int n){     if (n>1) Console.WriteLine(new String('-', n));}
You might be interested in
Please, ignore
Komok [63]
Abhheoorioooooohhhhh omg
3 0
3 years ago
Read 2 more answers
What is the downside of wider channel bandwidth?
Lana71 [14]

Answer: Wider channel bandwidth has several downside or disadvantages to it. Some of these are as follow:

a) Higher channel bandwidth means lower will be the number of channels being utilized.

b) Wider bandwidth may lead to an increase in the speed but on the other hand, it'll lead to several interference problems.

6 0
3 years ago
Ross has to create a presentation for his class but can't decide on a topic. What should he do?
mylen [45]
Resheach thngs that instrest him and that fit the guidlines
6 0
3 years ago
Read 2 more answers
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
Zina [86]

Answer:

Here is the C++ program:

#include <iostream> // to include input output functions

using namespace std; // to identify objects like cin cout

int counter(string userString, char character) { //function counter

   int count = 0;   // counts the no of times a character appears in the string

   for (int i=0;i<userString.length();i++)  

// loop to move through the string to find the occurrence of the character

       if (userString[i] == character) //if characters is found in the string

           count++;   //counts the occurrence of the character in the string

   return count; }   //returns the no of times character occurs in the string

int main() { //start of the main() function body

   string s; // stores the string entered by the user

   cout<<"Enter a string: "; //prompts user to enter the string

   cin>>s; //reads the string from user

   char ch; //stores the character entered by the user

   cout<<"Enter a character: "; //prompts user to enter a character

   cin>>ch; //reads the character from user

   cout << counter(s, ch) << endl; }  

//calls counter function to find the number of times a character occurs in the //string

Explanation:

The counter function works as following:

It has a count variable which stores the number of occurrences of a character in the userString.

It uses a for loop which loops through the entire string.

It has i position variable which starts with the first character of the string and checks if the first character of userString matches with the required character.

If it matches the character then count variable counts the first occurrence of the character and in the userString and is incremented to 1.

If the character does not match with the first character of the userString then the loops keeps traversing through the userString until the end of the userString is reached which is specified by the length() function which returns the length of the string.

After the loop ends the return count statement is used to return the number of occurrences of the character in the userString.

The main() function prompts the user to enter a string and a character. It then calls counter() function passing string s and character ch arguments to it in order to get the number of times ch appears in s.

The output is attached in a screenshot.

6 0
3 years ago
A recipe for deducing the square root involves guessing a starting value for y. Without another recipe to be told how to pick a
Gnoma [55]

Answer:

TRUE

Explanation:

TRUE - A recipe for deducing the square root involves guessing a starting value for y. Without another recipe to be told how to pick a starting number, the computer cannot generate one on its own.

5 0
3 years ago
Other questions:
  • What is microsoft excel
    12·1 answer
  • Why is it important to evaluate the website on which you plan to shop?
    11·2 answers
  • Wich is the last step in conducting a URL search
    14·2 answers
  • Do you think the current system of punishment in the United States works? Why? What would you change?
    13·1 answer
  • Draw the hierarchy chart and then plan the logic for a program that calculates a person’s body mass index (BMI).
    11·1 answer
  • A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    13·1 answer
  • if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
    11·2 answers
  • It specifies the amount of memory needed to store data.
    7·2 answers
  • Describe the differences and similarities between the most common operating systems used for Mac, PC, and Linux in
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!