answer.
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
ExtremeBDS [4]
1 year ago
7

Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n

ewline. Ex: printFeetInchShort(5, 8) prints: 5' 8" Hint: Use \" to print a double quote.

Computers and Technology
2 answers:
umka2103 [35]1 year ago
8 0

Answer:

public static void printFeetInchShort(int numFeet, int numInches){

      System.out.println(numFeet+"' "+numInches+"\"");

  }

Explanation:

Don't forget the brace!

worty [1.4K]1 year ago
4 0

Answer:

The program to this question as follows:

Program:

//header file

#include <iostream> //defining header file

using namespace std;

void printFeetInchShort(int numFeet,int numInches); //decalring method printFeetInchShort  

void printFeetInchShort(int numFeet,int numInches)//defining method printFeetInchShort

{

cout<<"height: "; // print message

cout<<numFeet<<"\'"<<""<<numInches<<"\""; //print value

}

int main() //defining main method

{

int numFeet, numInches; //defining integer variable

cout<<"Enter height feet: "; //print message

cin>>numFeet; //input value by user

cout<<"Enter height inches: "; //print message

cin>>numInches; //input value by user

printFeetInchShort(numFeet,numInches); //calling method printFeetInchShort    

return 0;

}

Output:

Enter height feet: 5

Enter height inches: 9

height: 5'9"

Explanation:

In the above C++ language program, first, a header file is included, that uses the basic function, in the next step, the "printFeetInchShort()" method is defined, in the method two integer variables passed as a parameter, inside this method a print function "cout" is used, that print user input value with single and double quote.

Then the main method is declared, inside this method two integer variables "numFeet and numInches" are defined, which is used to take input value by user and pass the value in "printFeetInchShort()" function parameter and call the function.

You might be interested in
Write a function summarize_letters that receives a string and returns a list of tuples containing the unique letters and their f
marysya [2.9K]

Answer:

Explanation:

2nd part

def summarize_letters(string):

#Initializaing a empty dictionary

character_counter = {}

#converting all the characters to lowercase

string_lower = string.lower()

for i in string_lower:

#checking if the chacter presents in the dictionary then increase it by one and also to check if the character is alphabet

if i in character_counter and i.isalpha():

character_counter[i] = character_counter[i]+1

#checking if the character not present in the dictionary then assign 1

if i not in character_counter and i.isalpha():

character_counter[i] = 1

#converting the dictionary to list of tuples

list_of_tuples = [(k, v) for k, v in character_counter.items()]

return list_of_tuples

#3rd Part

#initializing a string of characters in alphabets

alphabets = 'a b b b b B A c e f g d h i j k B l m M n o p q r s P t u v w x y z'

print(summarize_letters(alphabets))

#importing the string module

import string

#pulling all the alphabets

alphabet = set(string.ascii_lowercase)

#checking if our hardcoded string has all the alphabets

if set(alphabets.lower()) >= alphabet:

print('The string ' +alphabets+' has all the letters in the alphabet ')

3 0
2 years ago
Write a SQL query to find the population of the planet named 'Caprica' -- 10 points Find the first name, last name, and age of p
Artemon [7]

The question is incomplete! Complete question along with answer and step by step explanation is provided below.

Please find the attached question.

Answer:

a) SQL Query:

SELECT population

FROM bsg_planets

WHERE name='Caprica';

b) SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE lname!='Adama';

c) SQL Query:

SELECT name, population

FROM bsg_planets

WHERE population > 2600000000

d) SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE age IS NULL;

Explanation:

a) Write a SQL query to find the population of the planet named 'Caprica'

Syntax:

SELECT  Column

FROM TableName

WHERE Condition;

For the given case,

Column = population

TableName  = bsg_planets

Condition = name='Caprica'

SQL Query:

SELECT population

FROM bsg_planets

WHERE name='Caprica';

Therefore, the above SQL query finds the population of the planet named 'Caprica' from the table bsg_planets.

b) Find the first name, last name, and age of people from bsg_people whose last name is not 'Adama'

Syntax:

SELECT  Column1, Column2, Column3

FROM TableName

WHERE Condition;

For the given case,

Column1 = fname

Column2 = lname

Column3 = age

TableName  = bsg_people

Condition = lname!='Adama'

SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE lname!='Adama';

Therefore, the above SQL query finds the first name, last name and age of people whose last name is not 'Adama' from the table bsg_people.

c) Find the name and population of the planets with a population larger than 2,600,000,000

Syntax:

SELECT  Column1, Column2

FROM TableName

WHERE Condition;

For the given case,

Column1 = name

Column2 = population

TableName  = bsg_planets

Condition = population > 2600000000

SQL Query:

SELECT name, population

FROM bsg_planets

WHERE population > 2600000000

Therefore, the above SQL query finds the name and population of the planets with a population larger than 2,600,000,000 from the table bsg_planets.

d) Find the first name, last name, and age of people from bsg_people whose age is NULL

Syntax:

SELECT  Column1, Column2, Column3

FROM TableName

WHERE Condition;

For the given case,

Column1 = fname

Column2 = lname

Column3 = age

TableName  = bsg_people

Condition = age IS NULL

SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE age IS NULL;

Therefore, the above SQL query finds the first name, last name and age of people whose age is NULL from the table bsg_people.

6 0
2 years ago
Read 2 more answers
Given sphereRadius and piVal, compute the volume of a sphere and assign to sphereVolume. Look up the equation online (e.g., http
fenix001 [56]

Answer:

  1. #include <stdio.h>
  2. int main()
  3. {
  4.    const double piVal = 3.14159;
  5.    double sphereVolume = 0.0;
  6.    double sphereRadius = 0.0;
  7.    
  8.    sphereRadius = 1.0;
  9.    sphereVolume = 4.0/ 3.0 * piVal * sphereRadius * sphereRadius * sphereRadius;
  10.    
  11.    
  12.    printf("Sphere volume: %lf\n", sphereVolume);
  13.    return 0;
  14. }

Explanation:

Firstly we can identify the formula to calculate volume of sphere which is

Volume = 4/3 \pi r^{3}

With this formula in mind, we can apply this formula to calculate the volume of sphere in Line 10. This is important to perform floating-point division 4.0/3.0 to ensure the resulting value is a floating value as well. Since we have been given piVal and sphereRadius, we can just multiply the result of floating-point division with piVal and sphereRadius and get the sphereVolume value.

At last, display the sphere volume using printf method (Line 13).

6 0
2 years ago
How has the perception of the hacker changed over recent years? What is the profile of a hacker today?
finlep [7]

Answer:

Hackers frequently spend long hours examining the types and structures of targeted systems because they must use guile, or fraud to bypass the controls placed on information owned by someone else.

Explanation

The perception of a hacker has evolved over the years.

  • The traditional hacker profile was a male, aged 14 to 18.
  • 76% of hackers are men whose ages are between 14 years (8%) to 50 (11%). The average age is 35 years (43%).
  • A hacker is persevering, patient, creative, bright and having a passion for what he does.
  • Hackers today can be expert or novices.
  • The experts create the software and schemes to attack computer systems.
  • While the novices merely use software created by the experts.
4 0
2 years ago
When handling project scope creep, which are two things that all parties involved need to be aware of?
WARRIOR [948]

Additional resource needed for the projects

Additional time needed for the project

<u>Explanation:</u>

In any project handing their will expected diversion and add on requirement, so to complete a project additional time and additional resource is required to finish a project.

As advice due the project details, end user has keep enough buffer for deviations on resource of man power and additional times taken to finish the project.

While design the project each scope of work is measure with additional time to complete the task

Each scope of work is considered as task in project management.

3 0
1 year ago
Other questions:
  • CAPTCHAs can be used as a form of signature to create a valid contract in e-commerce. True False
    6·2 answers
  • Susan needs to change the color scheme in all the slides of her multimedia presentation. The presentation software program Susan
    10·2 answers
  • Assume that the variables gpa, deansList and studentName, have been declared and initialized. Write a statement that adds 1 to d
    13·1 answer
  • Add the following 2's complement binary numbers. Also express the answer in decimal. a. 01+ 1011b. 11+ 01010101c. 0101+ 110d. 01
    8·1 answer
  • Consider a maximal flow problem in which vehicle traffic entering a city is routed among several routes before eventually leavin
    7·1 answer
  • Use the image below to answer this question.
    14·1 answer
  • The maximum number of times the decrease key operation performed in Dijkstra's algorithm will be equal to ___________
    14·1 answer
  • The Boffo Balloon Company makes helium balloons. Large balloons cost $13.00 a dozen, medium-sized balloons cost $11.00 a dozen,
    13·1 answer
  • Write code which takes a sentence as an input from the user and then prints the length of the first word in that sentence.
    6·1 answer
  • The height of a small rocket y can be calculated as a function of time after blastoff with the following piecewise function: y 5
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!