You didn't include the original function, but the new function will contain something like:
function kelvin_to_celsius(k)
{
return k - 273.15;
}
Depending of course on your programming language.
The outcome for negative Kelvin is undefined, you could test for that.
Answer:
- food_category = {
- "Fruits": ["Apple", "Strawberries", "Orange"],
- "Vegetables": ["Carrots", "Peas", "Onions"],
- "Meats": ["Chicken", "Beef", "Mutton"]
- }
-
- for cat in food_category:
- output = cat + ": "
- for food in food_category[cat]:
- output += food + ", "
- print(output)
-
- answer = input("Do you want to add category or food (Y - Yes N - No): ")
-
- while(answer == "Y"):
- choice = input("New Category (N) or New Food (nf): ")
-
- if(choice == "N"):
- new_cat = input("Enter new category name: ")
- if(new_cat not in food_category):
- food_category[new_cat] = ""
- elif(choice == "nf"):
- cat = input("Enter category: ")
- new_food = input("Enter new food name: ")
- food_category[cat].append(new_food)
-
- answer = input("Do you want to add new category or food (Y - Yes N - No): ")
-
- print("All food categories: ")
- for cat in food_category:
- print(cat)
-
- selected_cat = input("Select a category to view the food list: ")
- output = ""
- for food in food_category[selected_cat]:
- output += food + ", "
- print(output)
Explanation:
The solution code is written in Python 3.
Firstly, create a food category dictionary data structure (Line 1 -5). Next, display all the food category and the food in each category (Line 7 - 11)
Next prompt user to feedback if they wish to add new category or new food (Line 13).
While the answer is yes prompt user to enter their choice, either category or food and use if else if statements to handle the choice made by the user. If the choice is new category, prompt user to enter new category name and check if the new category is already exist in the dictionary. If not, add that category to dictionary (Line 18 - 21).
If the choice is food, nf, prompt user to input food category and enter the new food name and add it to the food_category list (Line 22 - 25).
After that prompt user to enter if they wish to continue to add new data (Line 27).
After collecting all info from user, write a for loop to display all the categories (Line 29 - 31).
At last, prompt user to select a category and display all the food of the selected category (Line 33 - 37).
The rules and guidelines for appropriate computer mediated communication are called Netiquette.
<h3>What is Netiquette?</h3>
Netiquette, which is a blend of “net” and “etiquette,” refers to the polite and appropriate behavior when communicating with others online.
These rules are important as they help to improve communication skills, prevent misconceptions, and encourage only socially acceptable behavior when working or collaborating online.
Some of the DOs of Netiquette among others includes:
- Being mindful of your tone
- Use of emoticons
- Use of good grammar
Some of the DONTs among others includes:
- Overuse of abbreviations
- Unnecessary rants/Flaming
- Overusing caps
In conclusion Netiquette involves not doing what you would not do in person.
Learn more about Netiquette here:brainly.com/question/998689
B. Information can spread very quickly on the Internet.
C. If you say something mean online, you don’t have to worry about getting in a physical fight.
D. Anything someone says could stay on the Internet for a long time.
Cyber bullying can go full blown due to the simple fact that information that goes on the internet can be public, anonymous, and can last a very long time online.
Further Explanation:
Information can spread very quickly on the internet – Information online goes viral every day. Most people online are caught up in this kind of rapid spread of information. However, people who have intentions of getting involved in viral trends should carefully consider the effects of these trends and whether or not they will toxic to someone else. A good example is “roasting” someone online. People tend to cross the line while commenting on trends and may end up hurting people really bad emotionally.
If you say something mean online, you don’t have to worry about getting in a physical fight – Cyber bullies are best known as keyboard warriors. They behave aggressively online but when opportunities to face those they have aggressively bullied online, they will most likely not behave like that due to cowardice.
Anything someone says could stay on the Internet for a long time – Expect anything that goes online to stay online for a very long time. The internet never forgets. Information about someone will always re- surface and will be used against them when that day comes and will always turn out ugly.
Learn more about Cyber Bullying
brainly.com/question/1547453
brainly.com/question/11992465
#LearnWithBrainly