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
strojnjashka [21]
3 years ago
8

What is the code for this? I need it in python.

Computers and Technology
1 answer:
Leokris [45]3 years ago
3 0

Answer:

You could use the program Weight Watchers. It tells you everything that you have listed.

You might be interested in
Which type of software is for sale directly to consumers in stores and online?
Alex777 [14]

Answer: its b my guy

Explanation:

5 0
3 years ago
Create a Flash Card class. Flash Cards have a Question and an Answer, each of which are Strings. Your class should include a con
xeze [42]

Answer:

<u> FlashCard.java</u>

  1. public class FlashCard {
  2.    String Question;
  3.    String Answer;
  4.    public FlashCard(String q, String a){
  5.        this.Question = q;
  6.        this.Answer = a;
  7.    }
  8.    public String toString(){
  9.        String output = "";
  10.        output += "Question: " + this.Question + "\n";
  11.        output += "Answer: " + this.Answer;
  12.        return output;
  13.    }
  14.    public boolean equals(String response){
  15.        if(this.Answer.equals(response)){
  16.            return true;
  17.        }
  18.        else{
  19.            return false;
  20.        }
  21.    }
  22. }

<u>Main.java</u>

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        FlashCard card1 = new FlashCard("What is highest mountain?", "Everest");
  4.        FlashCard card2 = new FlashCard("What is natural satelite of earth?", "Moon");
  5.        FlashCard card3 = new FlashCard("Who is the first president of US?", "George Washington");
  6.        FlashCard cards [] = {card1, card2, card3};
  7.        for(int i=0; i < cards.length; i++){
  8.            System.out.println(cards[i]);
  9.        }
  10.    }
  11. }

Explanation:

In FlashCard.java, we create a FlashCard class with two instance variable, Question and Answer (Line 2 - 3). There is a constructor that takes two input strings to initialize the Question and Answer instance variables (Line 5-8). There is also a toString method that will return the predefined output string of question answer (Line 10 - 15). And also another equals method that will take an input string and check against with the Answer using string equals method. If matched, return True (Line 17 -24).

In Main.java, create three FlashCard object (Line 3-5) and then put them into an array (Line 6). Use a for loop to print the object (Line 8-10). The sample output is as follows:

Question: What is highest mountain?

Answer: Everest

Question: What is natural satelite of earth?

Answer: Moon

Question: Who is the first president of US?

Answer: George Washington

6 0
4 years ago
Write a program that reads an integer, and then prints the sum of the even and odd integers.
Tasya [4]

Answer:

#include <iostream>  // header file

using namespace std;  // namespace

int main ()

{

int n, x1, i=0,odd_Sum = 0, even_Sum = 0;  // variable declaration

cout << "Enter the number of terms you want: ";

 cin >> n;  // user input the terms

cout << "Enter your values:" << endl;

  while (i<n)  // iterating over the loop

{

cin >> x1;  // input the value

if(x1 % 2 == 0)  // check if number is even

{

even_Sum = even_Sum+x1;  // calculate sum of even number

}

else

{

odd_Sum += x1; // calculate sum of odd number.

}

i++;

}

cout << "Sum of Even Numbers is: " << even_Sum << endl;  // display the sum of even number

cout << "Sum of Odd Numbers is: " << odd_Sum << endl;  // display the sum of odd number

return 0;

}

Output:

Enter the number of terms you want:3

Enter your values:2

1

78

Sum of Even Numbers is:80

Sum of Odd Numbers is:1

Explanation:

In this program we enter the number of terms by user .After that iterating over the loop less then the number of terms .

Taking input from user in loop and check the condition of even. If condition is true then adding the sum of even number otherwise adding the sum of odd number.

Finally print the the sum of the even number and odd integers.

6 0
3 years ago
The expression that is tested by a switch statement must have a(n) __________ value.
Hitman42 [59]

The answer is relational.

6 0
4 years ago
A flexible collection of computers on the internet begins to perform tasks traditionally performed on corporate computers. Major
maw [93]

Answer:

The correct answer to the following question will be "The cloud computing framework is emerging as an important innovation area of business".

Explanation:

  • Cloud computing allows the company or business to remotely manage their records, providing a broad means of accessing their data anywhere, all time.
  • Essentially, you borrow a cloud service provider's server space or connections to applications and links across the Web. Rather than purchasing your own IT equipment, you rent from a provider and only charge for the services you need.
  • The guide helps you appreciate computing, as well as the different methods of cloud hosting, which can be used in your organization.

Therefore, it's the right answer.

8 0
4 years ago
Other questions:
  • The purpose of the img element's ________ attribute is to provide a method for a browser to display different images depending o
    7·1 answer
  • When do on loop conditions happen? (1 point)
    5·1 answer
  • Answer the following questions:
    7·1 answer
  • A comma is also called a statement terminator. A. True B. False
    8·1 answer
  • Which statement best describes a transition in PowerPoint?
    12·1 answer
  • There is an enormous amount of information on the Internet that is automatically separated into good content and not-so-good con
    15·1 answer
  • Write instruction to recharge mobile phone ​
    5·2 answers
  • 1. Write a programme to print the Fees Receipt of English High School Required Inputs Name of the Student Monthly Tuition Fees M
    10·1 answer
  • Photographs, illustrations, and videos are increasingly created an and viewed in digital formats. True or False​
    5·2 answers
  • I’m not very good at using word because this is my second time using it lol
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!