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
nikklg [1K]
3 years ago
14

1. If an F# function has type 'a -> 'b when 'a : comparison, which of the following is not a legal type for it? Select one:

Computers and Technology
1 answer:
Stella [2.4K]3 years ago
7 0

Answer:

B. string -> (int -> int)

Explanation:

We are going to perform comparison operations '->'. It is important to notice that the comparison operation gives us a bool value (True or False) and the comparison operation is legal if and only if the data types to be compared are the same.

Example:

int(4)->int(5) False

int(4)->int(4) True

int(4)->string(4) Error, data types don't match

For this reason:

  • A. Is legal because float -> float evaluates to True, True is a boolean value and bool -> bool is legal because both are the same data type.
  • B. Is illegal because int -> int evaluates to True, True is a boolean value and string is not a boolean (string -> bool).
  • C. Is legal because int is the same type than int.
  • D. Is legal because the list is the same type than list regardless it's content.

Note:

The operations inside parentheses are evaluated first.

List is a type by itself regardless of its content.

You might be interested in
The one who will defeat me in this typing race I will mark the one brainliest:
fredd [130]

Answer:

yes

Explanation:

can you send the link....

5 0
2 years ago
Read 2 more answers
Programs for embedded devices are often written in assembly language. Some embedded processors have limited instructions, like M
oksano4ka [1.4K]

Answer:

#include <iostream>

using namespace std;

int main()

{

   char address[2];

   int tag, firstBit, secondBit, setNumber;

   int cache[4][2]={{1,5}, {2,4}, {3,2}, {6,0}};

   cout << "Enter the address as hex(in small letters: "<

   cin >> address;

   for (int i < 0; i < 8; i++){

       if (address[0] == '0'){

           tag = 0;

           firstBit = 0;

        } else if (address[0] == '1'){

           tag = 0;

           firstBit = 1;

        } else if (address[0] == '2'){

           tag =1;

           firstBit = 0;

        } else if (address[0] == '3'){

           tag = 1;

           firstBit = 1;

        } else if (address[0] == '4'){

           tag = 2;

           firstBit = 0;

        } else if (address[0] == '5'){

           tag = 2;

           firstBit = 1;

        }  else if (address[0] == '6'){

           tag = 3;

           firstBit = 0;

       } else if (address[0] == '7'){

           tag = 3;

           firstBit = 1;

       }  else if (address[0] == '8'){

           tag = 4;

           firstBit = 0;

       } else if (address[0] == '9'){

           tag = 4;

           firstBit = 1;

       }   else if (address[0] == 'A'){

           tag = 5;

           firstBit = 0;

       } else if (address[0] == 'B'){

           tag = 5;

           firstBit = 1;

       }  else if (address[0] == 'C'){

           tag = 6;

           firstBit = 0;

       } else if (address[0] == 'D'){

           tag = 6;

           firstBit = 1;

        }  else if (address[0] == 'E'){

           tag = 7;

           firstBit = 0;

       } else if (address[0] == 'F'){

           tag = 7;

           firstBit = 1;

       } else{

           cout<<"The Hex number is not valid"<< endl;

        }

   }

   if(address[1]>='0' && address[1]<'8'){

       secondBit = 0;

  }  else if(address[1]=='8'|| address[1]=='9'||(address[1]>='a' && address[1]<='f')){

       secondBit = 1;

   }  else{

       cout<<"The Hex number is not valid"<< endl;  

       return 0;

   }

   setNumber = firstBit * 2 + secondBit;

   if(cache[setNumber][0]==tag || cache[setNumber][1]==tag){

       cout<<"There is a hit";

   } else{

       cout<< "There is a miss";

   }

   return 0;

}

Explanation:

The C++ source code prompts the user for an input for the address variable, then the nested if statement is used to assign the value of the firstBit value given the value in the first index in the address character array. Another if statement is used to assign the value for the secondBit and then the setNumber is calculated.

If the setNumber is equal to the tag bit, Then the hit message is printed but a miss message is printed if not.

4 0
2 years ago
Select all the correct answers.
gtnhenbr [62]

Answer:

If you want to learn coding than get a game and look at the code inside.

Explanation:

I sugest terraria

8 0
3 years ago
What is web browser <br>​
xeze [42]
An application used to access and view websites
7 0
3 years ago
Read 2 more answers
Considering current online newspaper editions and the characteristics of digital age media, how do you think newspaper design mi
NeX [460]
One way that a newspaper design may change in the future is that they will only be available in an interactive online edition. The correct answer is B. <span />
6 0
3 years ago
Other questions:
  • The class Date has a single constructor that accepts the integer value: a month- (1 for January through 12 for December), a day
    13·1 answer
  • What does Intel mean in this phrase(collect all intel).
    9·2 answers
  • When you declare a string data type, you are actually creating an object from the?
    5·1 answer
  • Here's a thought: Why does your Brainly ranking keep going down?
    6·2 answers
  • You can use RWA to demonstrate how to do something special on the web, such as displaying articles found on websites that suppor
    15·1 answer
  • Kaitlin likes a particular design theme, but she is not sure about every single color for bullets, backgrounds, etc found in the
    5·2 answers
  • Which of the following is no longer necessary when you use HTML5 to develop Webpages? Please Hurry This Is For An Assignment due
    13·1 answer
  • Which of the following laptop features allows users to overcome keyboard size restrictions?
    11·1 answer
  • Two routers connect with a serial link, each using its S0/0/0 interface. The link is currently working using PPP. The network en
    6·1 answer
  • Which characteristics support an agile mis infrastructure?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!