Questions
1 Write structured pseudocode to show the following: If you are at home, get comfortable and...

1 Write structured pseudocode to show the following: If you are at home, get comfortable and take a nap while you are sleepy, otherwise do not take a nap. 2 Write structured pseudocode to show the following: when you are on time for work you have time to buy coffee 3 Write structured pseudocode to indicate that you will keep drying your hair while it is still wet 4 Write structured pseudocode to show the following: when you are on time for work you have time to buy coffee

In: Computer Science

Given the following HTML code (You are not allowed to add additional id or class to...

Given the following HTML code (You are not allowed to add additional id or class to the file test.html)

test.html

  1. <h1>Down the Rabbit-Hole</h1>
  2. <div class="bb" >    
  3.    <p class="bb" >Alice was beginning to get very tired ...</p>
  4.    <br/>
  5.    <p> Alice </p>
  6. </div>
  7. <div id="aa">
  8.    <p>Down, down, down. Would the fall never come to an end</p>
  9.    <div> <p class="bb" >I wonder if I shall fall right …</p> </div>
  10. </div>
  11. <h1> Upcoming Event </h1>
  12. <p> Excitng Event: 101 </p>
  13. <p> A limited number of tickets area available. Email me. </p>

a) I want to style the text from line 7 to 10. Write the CSS code to achieve the goal so that the text from line 7 to 10 in red.

Write code here:

b) Write the CSS code to make all <p> tags of class bb in green. (I mean make line #3 #9 in green text)

Write code here:

c) Write the CSS code to make line #9 in red only.

Write code here:

d) Write the CSS code to make line#12 in red only.

Write code here:

In: Computer Science

Hi, Im not sure why this only continues to loop when option 1 is selected. Thank...

Hi, Im not sure why this only continues to loop when option 1 is selected.

Thank you

#include<iostream>
using namespace std;

class Car{
   private:
       string make;//variable
       int price;//variable
      
       public:
           Car(string make, int price){//two parameter constructor
               this->make = make;
               this->price = price;
           }
       string getMake(){//get make from user
           return this->make;
       }
       int getPrice(){//get price from user
           return this->price;
       }
};
#include <iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<iomanip>
#include"Car.h"
using namespace std;

void DisplayMenu(){//method to display menu
   cout<<"\n1. Add car to inventory";
   cout<<"\n2. Delete car from inventory";
   cout<<"\n3. Print inventory";
   cout<<"\n4. Exit";
   cout<<"\nYour choice: ";
}

void addData(vector<Car>& Inventory){//method to add data
   string make;
   int price;
   cout<<"Type of car: ";
   cin>> make;
   cout<<"Price of car: ";
   cin>> price;
  
   Car newcar(make, price);
   Inventory.push_back(newcar);      
}

void deleteData(vector<Car>& Inventory){//method to delete data
   string carToDelete;
   cout<<"Type of car to delete: ";
   cin>>carToDelete;
   int position = -1;
   for(int i = 0; Inventory.size(); i++){
       if(carToDelete.compare(Inventory[i].getMake()) ==0)
       position = i;
   }
   if(position == -1){
   cout<<"No such car in inventory";
   return;
   }
   Inventory.erase(Inventory.begin() + position );
}

void printData(vector<Car>& Inventory){//method to print data
cout<<"\nMake"<<" Price"<<"\n";
   cout<<"----"<<" -----\n";
   for(int i = 0; i<Inventory.size(); i++){      
       cout<<setw(0)<<Inventory[i].getMake()<<setw(11)<<Inventory[i].getPrice()<<endl;
       }      
}

int main() {
   cout<<"Welcome to the JJC Dealership Inventory Program\n";
   vector<Car>Inventory;//initialize vector
   int choice = 1;//variable
  
  
   while(true){      
       DisplayMenu();//display menu
       cin>>choice; //get user choice
      
   switch(choice){//switch statement
       case 1:
           addData(Inventory);
           break;
       case 2:
           deleteData(Inventory);
           break;
       case 3:
           printData(Inventory);
       case 4:
           return 0;
           break;
       default:
           cout<<"Invalid Entry\n";
           break;
   }
   }
   return 0;
}

In: Computer Science

What is the motivation of the OR model? What are the main additions in ORDB?

What is the motivation of the OR model? What are the main additions in ORDB?

In: Computer Science

Briefly compare the following standards: 802.11a, 802.11b, and 802.11g.

Briefly compare the following standards: 802.11a, 802.11b, and 802.11g.

In: Computer Science

Write a program that implements the pseudocode below: 1. Ask the user for the number of...

Write a program that implements the pseudocode below:

1.  Ask the user for the number of days until finals.
2.  Print out the weeks until finals (weeks = days // 7)
3.  Print out the leftover days (leftover = days % 7)

Note: Always have some labeling (identifying) text to explain the meaning of any numbers printed.
And, do not forget to have your name and what the program does as comments in the beginning of your file.

In: Computer Science

the key question is how does the power to regulate interstate commerce affect the kinds of...

the key question is how does the power to regulate interstate commerce affect the kinds of legislation that Congress can pass? Would any of the great Civil Rights bills, environmental bills (Clean Air and Water), regulation of employment (FLSA, Title VII, OSHA) been possible without the commerce clause standing behind the authority of Congress to regulate?

In: Computer Science

"After the first calculation is performed, the program should ask the user if they would like...

"After the first calculation is performed, the program should ask the user if they would like to continue. They will type in the word “quit” if they wish to end the program. If they wish to continue, they will enter yes than enter a new length of a triangle side and the string they would like on their sign."

How could I show this in code? Please give examples asap. I don't understand loops at all. In java please

In: Computer Science

A) What is the minimum and maximum number of zeros in a 4-bit string? Use roster...

A) What is the minimum and maximum number of zeros in a 4-bit string? Use roster notation and find the range of f.

(The first elements in the range is f(0,0,0,0) = 0)

B) For the functions below, indicate whether the function is: Onto ,One-to-one ,Bijection.

i) f: Z → Z, f(x) = 5x - 4

ii) f: Z → Z, f(x) = 5x - 4

C) Start with the number n = 54527. Divide n by 5 and round the result down to an integer. Keep repeating the division and rounding step until the resulting number is less than 5. How many divisions are performed? You can use a calculator for this problem, but you should not have to actually perform all of the divisions. Provide an integer answer.

D) Start with the number n = 32844. Divide n by 7 and round the result down to an integer. Keep repeating the division and rounding step until the resulting number is less than 7. How many divisions are performed? Provide an integer answer.

 

This is the discerete structures problem.

This is the discerete structures problem.

In: Computer Science

c++ CHRONO CLOCK wrong format.... So right now, the code im using is using std::chrono::system_clock; std::time_t...

c++ CHRONO CLOCK wrong format....

So right now, the code im using is using std::chrono::system_clock; std::time_t tt = system_clock::to_time_t (system_clock::now()); struct std::tm * ptm = std::localtime(&tt); std::cout << "Current time: " << std::put_time(ptm,"%X") << '\n'; std::this_thread::sleep_for (std::chrono::seconds(7)); It is simple in that this is in a loop, and chrono sleep_for delays the system for however many seconds. The problem is that it is in the HH:MM:SS format when I really need seconds.milliseconds to show the system clock transaction time. How would I do this? I really just need someone to explain the code, why is it making a struct? And what should I do to change the format? Thanks!

In: Computer Science

Consider the following code segment: pid_t pid; pid = fork(); if (pid == 0) { /*...

Consider the following code segment:

pid_t pid;

pid = fork();

if (pid == 0) { /* child process */

pthread_create( ... );

fork();

}

pthread_create( ... );

fork();

the remaining code (not shown) does not call fork() nor call pthread_create(). Assume each invocation to fork() or pthread_create() was successful.

a. How many unique processes are created (including the first main or root process)? Justify your answer.

b. How many unique threads are created by pthread_create()? Justify your answer.

In: Computer Science

(Great Circle Distance) Write a program great_circle.py that takes four floats x 1 , y 1...

(Great Circle Distance) Write a program great_circle.py that takes four floats x 1 , y 1 , x 2 , and y 2 (latitude and longitude in degrees of two points on Earth) as command-line arguments and writes the great-circle distance (in km) between them, given by the equation

d = 111 arccos(sin(x 1 ) sin(x 2 ) + cos(x 1 ) cos(x 2 ) cos(y 1 − y 2 )).

$python3 great_circle .py 48.87 -2.33 37.8 -122.4

8701.389543238289

In: Computer Science

i) Explain in brevity S DES. ii) Discuss how keys are generated in IDEA. iii)  Explain the...

i) Explain in brevity S DES.

ii) Discuss how keys are generated in IDEA.

iii)  Explain the working of DES.

In: Computer Science

explain Information security objectives as drivers for security architecture development.

explain Information security objectives as drivers for security architecture development.

In: Computer Science

Given a Local Area Network (LAN) and Wide Area Network (WAN), identify and analyze the inherent...

Given a Local Area Network (LAN) and Wide Area Network (WAN), identify and analyze the inherent weaknesses and exposures, identify control techniques commonly used to provide security of data and control over access to the network, and demonstrate how a security plan functions to safeguard against unauthorized network access.

In: Computer Science