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
Mice21 [21]
2 years ago
11

Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Everyti

me someone clicks the "addItemButton", she would like the variable to increase by 1. What code should Jasmine insert where it says in order for her app to work?a. cart total = 1.b. cart total + 1.c. cart total = cartTotal +1.d. var cart total = cartTotal + 1.e. var cart total + 1.
Computers and Technology
1 answer:
Gemiola [76]2 years ago
6 0

Answer:

b. cart total + 1

Explanation:

A. cart total=1 do increment the total with every 1 click here, it only 're-assigns cart total with value 1 for every click, hence it's always 1.

B. In every click, 1 is always added to the previous value of cart total, like addItemButton(cart total+1) or so.

C. This would have worked too if "cart total" and "cartTotal" where of same type.

D. cart total is just being initially defined here.

E. Likewise here, var shows that cart total has just only been declared.

You might be interested in
Company A has a project plan for a new product under development. The product will be one of many released in the coming year. T
gizmo_the_mogwai [7]

Answer:

Company A

The ISO 27002 classification level that is most likely assigned to this document is:

b) Proprietary

Explanation:

The ISO 27002 classification levels adopted by commercial organizations are Restricted (top secret is preferred in government circles), Confidential, Internal (or proprietary), and Public. Since the new product is under development, one of many, and most likely known to the project team, the project plan will be classified as Proprietary.  Company A designates this document as Proprietary or Internal to show that disclosure of the information to its competitors is not allowed.  This level of classification shows that Company A can establish intellectual property rights over the document.

4 0
2 years ago
Write a bool function isPalindrome that takes one string parameter and returns true if that string is a palindrome and false oth
kkurt [141]

Answer:

Here is the bool function isPalindrome:

bool isPalindrome(string s)

{  bool palindrome;      

 int j;

 int len = s.length();

 for (int i =0, j= len-1; i < len/2; i++, j--)  

   if (s[i] == s[j])

     palindrome = true;  

   else

     palindrome = false;

 return palindrome; }

Explanation:

The bool function isPalindrome takes a string as parameter and returns true if the string is a palindrome or false if the string is not palindrome. The string variable s holds the string value. In function isPalindrome, there is a bool type variable palindrome. bool is a data type which is used to hold values true or false which is then stored in the palindrome variable.

Next it is being found that how many characters are there in the input string using length() function which returns the length of the string. The length of the string is stored in int type variable len.

Next the for loop starts which has two variables i and j where i starts at 0 position of the input string and j starts at the last position of the string. These two variables move or traverse along the string this way. i variable stops when half the length of the input string is reached. At the end of every iteration i moves forward by the increment of its value to 1 and j moves backwards by the decrement  of its value to 1.

Every the body of  the loop executes, there is an if condition in the body of the loop which checks if the string is a palindrome. This is checked by matching the character at position/index i with the character at position j of the string. This will continue character by character until the i reached half the length of the input string and if every character in i was matched to every character in j then palindrome = true; statement is executed which returns true as the string is a palindrome otherwise palindrome = false; is returned as the string is not a palindrome.

For taking input string from the user and to check if the function isPalindrome() works correctly a main() function is written which takes input string from the user and reads in variable str calls isPalindrome() function. If the string is palindrome then the cout statement in main() function prints the message: String is a palindrome and if the input string is not a palindrome the the following message is displayed in the output screen: String is not a palindrome

int main()

{

string str;

cout<<"Enter a string: ";

cin>>str;

if(isPalindrome(str))

cout<<"String is a palindrome";

else

cout<<"String is not a palindrome";

}

The screenshot of the program along with the output is attached.

7 0
2 years ago
"Why learning how to type is so important.
djverab [1.8K]
The productivity of a business depends on how things are done faster. To complete your work faster it is important to develop typing skills. Typing helps you to work comfortably on the computer, it aids in communicating with colleagues and customers, creating documents, and finding new information.
Hopefully this helped.
8 0
3 years ago
All air transportation carriers transport freight to some extent. True False
SCORPION-xisa [38]
TRUE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4 0
3 years ago
Read 2 more answers
A typeface, plus any special attributes applied to the text is called ________.
grandymaker [24]

Answer:

I would like to say font but not sure

3 0
2 years ago
Read 2 more answers
Other questions:
  • Consider a file system that uses inodes to represent files. Disk blocks are 2KB in size and a pointer to a disk block requires 4
    13·1 answer
  • What network setting do i need for a workgroup?
    5·1 answer
  • Mary needs to choose the menu in order to place the text in a desired fashion around the image.
    14·2 answers
  • Using the Invert Selection tool while something is selected in Paint will __________.
    14·1 answer
  • Jennifer frequently uses a few programs on her laptop. Where will she find all the frequently used program icons in her computer
    13·1 answer
  • Fatal error: Class 'Drush\Commands\DrushCommands' not found in /Users/amy/testsite/Sites/acquia dev desktop/fresh-install/module
    7·1 answer
  • The hypothalamus controls the anterior pituitary by means of: a. releasing hormones b. second messengers c. third messengers d.
    14·1 answer
  • 14. Which of the following is NOT a
    6·2 answers
  • What is the difference between PowerPoint and Outlook?
    5·1 answer
  • Ten ways ict has helped in social development
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!