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
Firdavs [7]
3 years ago
13

Determine the exact output of the code:

Computers and Technology
1 answer:
stiv31 [10]3 years ago
4 0

Answer:

3

Explanation:

The function floor() is used to give the integer which is smaller than or equal to the provided decimal value.

for example:

let a=5.8

floor(a);

the function provides the value 5 (smaller than or equal to 5.8).

In the given code:

variable num assigns the number 3.14.

then, floor(3.14) gives the value 3 (smaller than or equal to 3.14).

then, the echo print the value on the screen.

Therefore, the correct answer is 3.

You might be interested in
Please help me with this coding problem :)
leonid [27]

Answer:

ll and lll

Explanation:

list dont be a looser

8 0
2 years ago
Using the notation exemplified in following question , list a set of tables and attributes (and identify keys) to represent the
Paha777 [63]

Answer:

Entities are - Students, CourseList, Advisor and CourseSelection.

Explanation:

The database is structure is designed using Crow Foot Database Notation as attached

6 0
2 years ago
Plz answer the following ​
Kruka [31]

Answer:

it trojan

Explanation:

what is the question asking

5 0
2 years ago
Read 2 more answers
Write a program that simulates flipping a coin repeatedly and continues until three consecutive heads. are tossed. At that point
quester [9]

Answer and Explanation:

#include <iostream>

#include <string>

#include <time.h>

#include <vector>

using namespace std;

//Takes user info

int user_info(string *name,char *gender){

   char G;

   cout<<"What is your name?: ";

   getline(cin, *name);

   cout<<"What is your gender(m/f):";

   cin>>G;

   cout<<endl;

   *gender = tolower(G);

   return 0;

}

//Toss coin(part 2)

bool coin_toss(double seed){

   double r;

   r = (double)seed/(double)RAND_MAX;

   //cout<<r;

   if (r<0.5) return true;

   return false;

}

//check results

float toss_result(vector<char> v,int *h){

   int num_heads=0;

   int num_toss = v.size();

   *h = 0;

   for(int i=0;i<num_toss;i++){

       if(v[i]=='h'){num_heads++;(*h)++;}

   }

   return (float)num_heads/(float)num_toss;

}

void show_result(int total_num,int head_num,float ratio){

   cout<<"it took you "<<total_num<<" tosses to get 3 heads in a row"<<endl;

   cout<<"on average you flipped heads "<<(ratio*100)<<"% of the time"<<endl;

}

int main()

{

   string name;

   char gender;

   string K; //Mr or Mrs

 

   cout<<"Welcome to coin toss! Get 3 heads in row to win!"<<endl;

 

   //part 1

   user_info(&name,&gender);

 

   if(gender == 'f') K = "Mrs.";

   else K = "Mr.";

 

   cout<<"Try to get 3 heads in a row. Good luck "<<K<<name<<"!"<<endl;

   char dummy = getchar();

 

   //part 2

   int num_toss;

   vector<char> toss_results;//store toss results

   bool result;//result of toss

   srand(time(0));

   while(true){

       //cout<<rand()<<endl;

       result = coin_toss(rand());

       cout<<"Press <enter> to flip"<<endl;

       while (1)

       {

           if ('\n' == getchar())

           break;

       }

     

 

     

       if(result) {toss_results.push_back('h');cout<<"HEAD"<<endl;}

       else {toss_results.push_back('t');cout<<"TAIL"<<endl;}

     

       num_toss = toss_results.size();

     

       if(num_toss>=3){

           if ((toss_results[num_toss-1] == 'h')&&(toss_results[num_toss-2] == 'h')&&(toss_results[num_toss-3] == 'h')){

               break;

           }

       }

   }

 

   //part 3

   float ratio_head;

   int num_of_heads;

   ratio_head = toss_result(toss_results,&num_of_heads);

 

   //part 4

 

   show_result(toss_results.size(),num_of_heads,ratio_head);

 

   return 0;

}

8 0
3 years ago
Which of the following are safety guidelines when socializing online?
DochEvi [55]

Answer:

All of them execpt five and three.

Explanation:

It is okay to have social media and receive messages.

3 0
2 years ago
Other questions:
  • All formulas that begin with =IF will
    5·1 answer
  • Why is knowledge of percent composition important in the mining process?
    7·1 answer
  • What is the biggest disadvantage of copying a worksheet into another workbook?
    13·1 answer
  • A type of touch screen that can be up to four feet by six feet is a(n) _____. plasma screen multitouch interface Electronic Pape
    10·2 answers
  • The producer thread will alternate between sleeping for a random period of time and inserting a random integer into the buffer.
    7·1 answer
  • The length property of the String object returns
    15·1 answer
  • If a small monster collector:- Has 16 small monster containment devices and intends to use all of them.
    10·1 answer
  • Write a program, named NumDaysLastNameFirstName.java, which prompts the user to enter a number for the month and a number for th
    13·1 answer
  • Micheal is the project manager in a company. He wants his organization to use technology for higher revenue and productivity. Wh
    13·1 answer
  • Where in PowerPoint should a user navigate to complete the tasks listed below?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!