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
saw5 [17]
2 years ago
8

Checkpoint 4.20 Assume hour is an int variable. Write an if statement that displays the message “Time for lunch” only if hour is

equal to 12.
Computers and Technology
1 answer:
cestrela7 [59]2 years ago
7 0

Answer:

if(hour == 12)

{cout << "Time for lunch";}

Explanation:

You might be interested in
Read first a user's given name followed by the user's age from standard input. Then use an ofstream object named outdata to writ
Stells [14]

Answer:

/*

* Program to write data to text file.

*/

#include<iostream>

#include<fstream>

#include<string.h>

using  namespace std;

int main()

{

//Variable to name and age of a person.

string name;

int age;

cout<<"Enter your name"<<endl;

cin>>name;

cout<<"Enter your age"<<endl;

cin>>age;

     //Creating object of ofstream.

   ofstream file;

   file.open ("outdata.txt");

   //Writing data to file named outdata.txt

   file<<name<<" "<<age;

   file.close();

 

}

Output:

Enter your name

John

Enter your age

25

Content of Output.txt:

John 25

Explanation:

To write data to a file  ofstream object is used. An ofstream object file is created first and then using this object a file named "outdata.txt" is created.

Finally using shift operator (<<), by means  of operator overloading, name and age of  person is transferred to file outdata.txt.

8 0
2 years ago
Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text?
Alika [10]

Answer:

a. grep 'b[au]nk$' myLine

Explanation:

grep is a command used for searching a specified pattern in a given text.

Our goal is to match the character sequence - bank or bunk at the end of line in a  given line referenced by myLine.

The regular expression for the specified match criterion is:

b[au]nk$

The second character can be either a or u.

$ indicates match at end of line.

So the overall grep command is :

grep 'b[au]nk$' myLine

8 0
2 years ago
How do i use autofill to fill the range A9:H11 with the formatting from the range A7:H8
myrzilka [38]

Answer:

See the explanation below

Explanation:

An image showing the range of cells is attached.

The task is to use autofill to fill the range of A9:H11 with the formatting from the range of A7:H8;

As shown in the image some cells are already filled. First, we highlight the cells A7:H8 and then we move the cursor to the end of the selected cell (precisely end of H8) over what is called Fill Handle and the cursor then turns into a black plus sign.

Hold down the right mouse button and drag over the wanted range of cells (A9:H11) and release.

A list of options is presented, this options include:

Copy cells, Fill series, Fill formatting only, Fill without formatting and so on.

From the displayed options, we select "Fill formatting only" and the cell (A9:H11) will have the same formatting as the cells (A7:H8).

3 0
2 years ago
The term that refers to the programmer reading the program from the beginning and stepping through each statement is _________.
Wewaii [24]

Answer: Desk checking

Explanation:

 The desk checking is one of the type of informal way manual testing in which the programmer use this method for evaluating or checking the coding or the different types of algorithm logic in the system.

  • It helps in identifying the errors in the program so that it can be executed properly without any interruption in the system.
  • It is one of the effective way for the error detection and also known as the modern debugging tool.

According to the given question, the desk checking is the term which is used to refers to the programmers for reading the given program step by step each statement. Therefore, Desk checking is the correct answer.

Therefore, Desk checking is the correct answer.

5 0
2 years ago
Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Els
kherson [118]

Answer:

// here is code in c.

#include <stdio.h>

// main function

int main()

{

// variable to store year

int year;

printf("enter year:");

// read the year

scanf("%d",&year);

// if year>=2101

if(year>=2101)

{

printf("Distant future");

}

//if year in 2001-2100

else if(year>=2001&&year<=2100)

{

   printf("21st century");

}

//if year in 19011-2000

else if(year>=1901&&year<=2000)

{

  printf("20th century");

}

// if year<=1900

else if(year<=1900)

{

  printf("Long ago");  

}

return 0;

}

Explanation:

Read the year from user.After this, check if year is greater or equal to 2101 then print "Distant future".If year is in between 2001-2100 then print "21st century".If year is in between 1901-2000 then print "20th century".Else if year is less or equal to 1900 then print "Long ago".

Output:

enter year:2018                                                                                                            

21st century

7 0
2 years ago
Read 2 more answers
Other questions:
  • When using preventative insecticides which holiday period should trigger an application?
    15·2 answers
  • Assignment 1 is to write a program that will write the lyrics to "X number of beers on the wall". Use only the main method. Prom
    11·1 answer
  • Identify the normalized form of the mantissa in 111.01.
    14·1 answer
  • Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
    6·1 answer
  • In the process of retrieving a specific memory from a web of associations a person needs to activate one of the strands that lea
    15·1 answer
  • Together with some anthropologists, you’re studying a sparsely populated region of a rainforest, where 50 farmers live along a 5
    15·1 answer
  • A Salesforce administrator adding a recommendations carousel component in Community Builder. The page displays correctly in Comm
    12·1 answer
  • Anime question where do i watch Itadaki! Seieki! 100 points
    15·2 answers
  • A script sets up user accounts and installs software for a machine. Which stage of the hardware lifecycle does this scenario bel
    5·1 answer
  • A data scientist is writing a Machine Learning (ML) algorithm using a large data set.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!