Answer:
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
int main() {
srand(time(NULL));
cout << rand() % 30 << endl;
cout << rand() % 30 + 30 << endl;
cout << rand() % 30 + 60 << endl;
}
Explanation:
rand() returns a pseudo-random integral number in the range between 0 and RAND_MAX. By applying the modulo operator, you map that to the desired range (30 in your case), then you add an offset.
Answer:
c. because RAW files are proprietary.
Explanation:
When scanners and digital cameras are used to capture images that are uncompressed or minimally processed image file, it is known as a RAW image file.
Generally, this file type are usually very large in size because of their lossless quality and does not have any alteration and as such have not been processed; thus, cannot be printed.
The term RAW image file is generally used to describe a variety of file formats, which are sometimes known as digital raw captures because RAW files are proprietary.
Your issue is on line 19 in your if statement. In python, if you have more than one condition in an if statement, you have to explicitly mention it after the or.
Your if statement is
if again == "Y" or "y":
However, this will always return true because the second statement simply asks "y".
To correct this, simply change the if statement to:
if again == "Y" or again == "y":
This will correct your code.
Another thing to consider is to always convert a userinput (whenever possible) to one version, this can be accomplished in your code by converting "again" into one version by using the .lower function.
again = input("Would you like to draw a 3rd card? Y or N? ")
again = again.lower()
Hope this helps!
The proper citation for your course of study -computer related- is APA (American Psychological Association) format. This citation format allows us to state the publication date, title , and authors in an organized and short fashion. All scholarly reports that are technology or psychology based, should be cited in APA format.
<span>I know this because it is the format I use for all of my college courses which are all Computer/Technology related. </span>