Answer:
sentence = "hello wow a stores good"
same_letter_count = 0
sentence_list = sentence.split()
for s in sentence_list:
if s[0] == s[-1]:
same_letter_count += 1
print(same_letter_count)
Explanation:
*The code is in Python.
Initialize the sentence with a string
Initialize the same_letter_count as 0
Split the sentence using split method and set it to the sentence_list
Create a for loop that iterates through the sentence_list. If the first and last of the letters of a string are same, increment the same_letter_count by 1
When the loop is done, print the same_letter_count
Answer:
Explanation:
The following program is written in Java. Using the program code from Purchase class in 5.13 I created each one of the fruit objects. Then I set the price for each object using the setPrice method. Then I set the number of each fruit that I intended on buying with the setNumberBought method. Finally, I called each objects getTotalCost method to get the final price of each object which was all added to the totalCost instance variable. This instance variable was printed as the total cost of the bill at the end of the program. My code HIGHLIGHTED BELOW
//Entire code is in text file attached below.
//MY CODE HERE
DecimalFormat df = new DecimalFormat("0.00");
oranges.setPrice(10, 2.99);
oranges.setNumberBought(2*12);
eggs.setPrice(12, 1.69);
eggs.setNumberBought(2*12);
apples.setPrice(3, 1);
apples.setNumberBought(20);
watermelons.setPrice(1, 4.39);
watermelons.setNumberBought(2);
bagels.setPrice(6, 3.50);
bagels.setNumberBought(12);
totalCost = oranges.getTotalCost() + eggs.getTotalCost() + apples.getTotalCost() + watermelons.getTotalCost() + bagels.getTotalCost();
System.out.println("Total Cost: $" + df.format(totalCost));
}
}
Answer:
D- Trojan Horse
Explanation:
Trojan horse is a malware that has hidden code and look legitimate in order to damage or transfer harmful action on the computer.
Example hackers can disguise as Trojan horse by spying on the victims computer in order to gain access to sensitive data on the computer over the network.
Each person has a electronic chip-enabled ID card, which lets them vote on the internet. The ID card is put into the card reader that is connected the computer. :)