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
tatiyna
2 years ago
13

Assume that the variables gpa, deansList and studentName, have been declared and initialized. Write a statement that adds 1 to d

eansList and prints studentName to standard out if gpa exceeds 3.5.
Computers and Technology
1 answer:
navik [9.2K]2 years ago
5 0

Following are the code in c language

#include <stdio.h>  // header file

int main()  // main function

{

   float gpa=4.5;  // assuming variable

   int deansList=8;

   char studentName[45]="patel";

if (gpa > 3.5)  // checking condition gpa exceeds 3.5.

{

deansList++;  // add 1 to deanslist

printf("%s", studentName);  // prints student name

}

return 0;

}

Explanation:

In this program we declared and initialized variables "gpa" with 3 of type "float", "deansList"   with 8 of type "int" and "studentName" with "Patel" of type "char array". after that we check  the condition if "gpa" exceed 3.5,  then the block of if is executed and  it increment the value  of "deansList" by 1 and print the studentName .

output

patel

You might be interested in
A drive is small enough to be carried in one's pocket.
hjlf

Answer: Pen

Explanation:

4 0
1 year ago
. Write a function wordscramble that will receive a word in a string as an input argument. It will then randomly scramble the le
inysia [295]

Answer: You can use the function randperm() to generate a random permutation of the indexes. so then you would use the random permutation to reorder the string array

Explanation:

4 0
1 year ago
Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
Drupady [299]

#include <iostream>

using namespace std;

class CarCounter {

  public:

     CarCounter();

     CarCounter(const CarCounter& origCarCounter);

     void SetCarCount(const int count) {

         carCount = count;

     }

     int GetCarCount() const {

         return carCount;

     }

  private:

     int carCount;

};

CarCounter::CarCounter() {

  carCount = 0;

  return;

}

CarCounter::CarCounter(const CarCounter &p){

carCount = p.carCount;

}

void CountPrinter(CarCounter carCntr) {

  cout << "Cars counted: " << carCntr.GetCarCount();

  return;

}

int main() {

  CarCounter parkingLot;

  parkingLot.SetCarCount(5);

  CountPrinter(parkingLot);

  return 0;

}

Sample output:  

Cars Counted: 5

8 0
2 years ago
Read 2 more answers
Consider a single-platter disk with the following parameters: rotation speed: 7200 rpm; number of tracks on one side ofplatter:
horsena [70]

Answer:

Given Data:

Rotation Speed = 7200 rpm

No. of tracks on one side of platter = 30000

No. of sectors per track = 600

Seek time for every 100 track traversed = 1 ms

To find:

Average Seek Time.

Average Rotational Latency.

Transfer time for a sector.

Total Average time to satisfy a request.

Explanation:

a) As given, the disk head starts at track 0. At this point the seek time is 0.

Seek time is time to traverse from 0 to 29999 tracks (it makes 30000)

Average Seek Time is the time taken by the head to move from one track to another/2

29999 / 2 = 14999.5 ms

As the seek time is one ms for every hundred tracks traversed.  So the seek time for 29,999 tracks traversed is

14999.5 / 100 = 149.995 ms

b) The rotations per minute are 7200

1 min = 60 sec

7200 / 60 = 120 rotations / sec

Rotational delay is the inverses of this. So

1 / 120 = 0.00833 sec

          = 0.00833 * 100

          = 0.833 ms

So there is  1 rotation is at every 0.833 ms

Average Rotational latency is one half the amount of time taken by disk to make one revolution or complete 1 rotation.

So average rotational latency is: 1 / 2r

8.333 / 2 = 4.165 ms

c) No. of sectors per track = 600

Time for one disk rotation = 0.833 ms

So transfer time for a sector is: one disk revolution time / number of sectors

8.333 / 600 = 0.01388 ms = 13.88 μs

d)  Total average time to satisfy a request is calculated as :

Average seek time + Average rotational latency + Transfer time for a sector

= 149.99 ms + 4.165 ms + 0.01388 ms

= 154.168 ms

4 0
1 year ago
Which of the following statements is incorrect? An operating system provides an environment for the execution of programs. An op
rosijanka [135]

Answer:

command line and graphical user interface

Explanation:

there were (and still are) operating system with no graphical user interface at all, as for example some Unix releases

8 0
1 year ago
Other questions:
  • Linda is making handouts for her upcoming presentation. She wants the handouts to be comprehensible to people who do not attend
    12·2 answers
  • In response to a recent outbreak of computer viruses, Babbage Industries, a large technology company, installs computer virus pr
    7·2 answers
  • Which of these words could byte pair encoding compress the most?
    13·1 answer
  • Consider a DASH system for which there are N video versions (at N different rates and qualities) and N audio versions (at N diff
    8·1 answer
  • Assume the input data is structured as follows: first there is a non-negative integer specifying the number of employee timeshee
    9·1 answer
  • Delete Prussia from country_capital. Sample output with input: 'Spain:Madrid,Togo:Lome,Prussia: Konigsberg' Prussia deleted? Yes
    13·1 answer
  • If, instead, charge 3 is located to the left of charge 1 at a point (on the x axis) that satisfies the conditions given in the p
    7·1 answer
  • Write a program that calculates taxi fare at a rate of $1.50 per mile. Your pro-gram should interact with the user in this manne
    12·1 answer
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • The hostel in which you plan to spend the night tonight offers very interesting rates, as long as you do not arrive too late. Ho
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!