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
ycow [4]
3 years ago
9

Define a function PrintFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand.

Computers and Technology
1 answer:
Kisachek [45]3 years ago
5 0

Answer:

I am writing a function using C++ programming language. Let me know if you want the program in some other programming language.

void PrintFeetInchShort(int numFeet , int numInches){

   cout<<numFeet<<"\' "<<numInches<<"\"";

The above function takes two integer variables numFeet and numInches as its parameters. The cout statement is used to print the value of numFeet with a single quote at the end of that value and  print the value of numInches with double quotes at the end of that value. Here \ backslash is used to use the double quotes. Backslash is used in order to include special characters in a string. Here i have used backslash with the single quote as well. However it is not mandatory to use backslash with single quote, you can simply use cout<<numFeet<<"' " to print a single quote. But to add double quotes with a string, backslash is compulsory.

Explanation:

This is the complete program to check the working of the above function.

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

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

void PrintFeetInchShort(int numFeet , int numInches){

//function to print ' and ' short hand

   cout<<numFeet<<"\' "<<numInches<<"\"";  }

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

  PrintFeetInchShort(5, 8);    }

//calls PrintFeetInchShort() and passes values to the function i.e. 5 for //numFeet  and 8 for numInches

If you want to take the values of numFeet and numInches from user then:

int main() {

   int feet,inches;  // declares two variables of integer type

   cout<<"Enter the value for feet:"; //prompts user to enter feet

   cin>>feet;  //reads the value of feet from user

   cout<<"Enter the value for inch:";   //prompts user to enter inches

   cin>>inches;      //reads the value of inches from user

  PrintFeetInchShort(feet, inches);   } //calls PrintFeetInchShort()

The screenshot of the program and its output is attached.

You might be interested in
List and briefly defined categories of security services.
Fynjy0 [20]
There are six categories of security services: authenticiation, access control, data confidentiality, data integrity, nonrepudiation, and availability service. First, is authentication service, which defines as the assurance that the communicator is legitimate and is the one that it claims to be. It can either be peer entity or data origin authentication. Second, access control which is to prevent any unauthorized uses of resources. After one is being authenticiated, then this service limit/controls who access? what accessing rights to the resources are allowed depending on the identified individuals. Data confifentiality: the protection of data from unauthorized disclosure. Data integrity: the assurance that data received are exactly as sent by an authorized entity (e.t.c, contain no modificafion, insertion, deletion, or replay).
7 0
3 years ago
1. Railroad tracks present no problems for a motorcyclist.
Yuki888 [10]

Answer: 1 is A

2 is D

Explanation:

3 0
3 years ago
3. Which swim_backwards method is called when sammy.swim_backwards() is executed? Why?
Georgia [21]
Classes called child classes or subclasses inherit methods and variables
4 0
2 years ago
Disadvantages of the divisional organization structure are _____. each division is able to operate independently from the parent
Fantom [35]

Answer:

Disadvantages:

1. A division may feel separated from the parent company because it has too much independence

2. This feeling of separation may lead to the division only worrying about meeting it's goals and objectives and not the companies as a whole

3. This system may be more expensive to operate and cannot share resources with other divisions

Explanation:

8 0
1 year ago
An ______ search is when the buyer looks for information beyond personal knowledge to help make the buying decision, such as che
victus00 [196]

Answer: External

Explanation: External search could be explained as the additional information gathered beyond an individual's personal knowledge or experience in a bit to influence the individual's decision on a particular product or topic. This additional information could include; information sought from friends and families, online or internet research on relevant site, blogs or publications.

Therefore, a buyer who asks a friend, checking the internet or visiting a showroom or make other enquiries beyond his personal knowledge in other to make buying decision is making an external search.

6 0
3 years ago
Other questions:
  • Distinguish the functional requirements an engineer would have to specify for a taxi dispatch system.
    8·1 answer
  • Number Analysis Program: Write a program that reads data from the text file numbers.txt. Assume the file contains a series of nu
    14·1 answer
  • What new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its impo
    7·1 answer
  • This question is for one of my classes I am in right now, and the question is:
    8·1 answer
  • Alice and Bob decide to communicate using NTRUEncrypt with parameters (N, p, q) = (7, 3, 29). Alice’s public key is h(x) = 3 + 1
    15·1 answer
  • (This is for photography segment exam btw)
    11·2 answers
  • Video is a medium that's looks real anyways, but is real________________.
    10·1 answer
  • 8.7 Code Practice: Question 2 edhesive
    14·2 answers
  • These days, a digital signature is just as legitimate and trusted as an old-fashioned John Hancock on paper.
    9·1 answer
  • Rosa is building a website for a multimedia company. She wants to add a drop-down menu functionality to the website's main page.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!